title: How do I set Spring Batch jobParameters in xml?
body: <p>This job.xml works great when using parameters.</p>
  
  <pre><code>&lt;beans&gt;
      &lt;bean id="testFileItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter" scope="step"&gt;
          &lt;property name="resource" value="#{jobParameters['paramFileOuput']}"/&gt;
          &lt;property name="shouldDeleteIfExists" value="true" /&gt;
  
          &lt;property name="lineAggregator"&gt;
                      ...
          &lt;/property&gt;
    &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>But what if I don't want to use job parameters but instead use Spring profiles...</p>
  
  <pre><code>&lt;beans&gt;
      &lt;bean id="testFileItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter" scope="step"&gt;
          &lt;property name="resource" ref="testFileOutput"/&gt;
          &lt;property name="shouldDeleteIfExists" value="true" /&gt;
  
          &lt;property name="lineAggregator"&gt;
                      ....
          &lt;/property&gt;
    &lt;/bean&gt;
    &lt;beans profile="dev"&gt;
         &lt;bean id="testFileOutput" class="java.lang.String"&gt;
             &lt;constructor-arg type="java.lang.String" value="file:c:/temp/testfile.txt" /&gt;
         &lt;/bean&gt;
    &lt;/beans&gt;
    &lt;beans profile="prod"&gt;
         &lt;bean id="testFileOutput" class="java.lang.String"&gt;
             &lt;constructor-arg type="java.lang.String" value="file:pathtoprod.txt" /&gt;
         &lt;/bean&gt;
    &lt;/beans&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>This appears to work.  But this just doesn't feel right.  Is there a way to set the parameter in the xml using profiles?  </p>
  
  <p>Something along these lines (this obviously doesn't work)</p>
  
  <pre><code>&lt;beans profile="dev"&gt;
      &lt;setJobParameter key="testFileOuput" value="file:c:/temp/testfile.txt" /&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>I can use any version of spring or springbatch.</p>