title: Gradle build multiple .war files with different properties file
body: <p>We are developing a new web application from scratch using Spring Boot and relevant dependencies and is built using Gradle.</p>
  
  <p>Our project has almost 5 stages of testing, with each stage executing on a different server and thus end up with slightly different configuration on each server.</p>
  
  <p>The above scenario is a very common situation and usually it is a practice I followed in my earlier projects to save the "Properties" file directly under the server's classpath so that the same .war file can be deployed on multiple servers and still have different configuration based on the server/environment.</p>
  
  <p>Now, the obvious disadvantage with the above setup is that - such a setup cannot be easily shared with other developers through some version controller. And further I cant use the power of "Process Resources" task in Gradle to introduce some dynamic properties during build process.</p>
  
  <p>Now, If I pull the .properties file within the project setup, then I can easily version control it, sharing becomes easier and I also can introduce dynamic properties through Gradle. The disadvantage being that I might have to prepare multiple .war files after updating the .properties file.</p>
  
  <p>There are two questions I have?</p>
  
  <ol>
  <li>What would be your thought on the above 2 ways? Given this situation what would you choose and why (Any other way of dealing with this scenario)?</li>
  <li>In the 2nd case of building multiple .war files, how do i re-run the war task to generate a new output file?</li>
  </ol>
  
  <p>Thanks!</p>