Gradle : Copy different properties file depending on the environment and create jar
<p>I am evaluating gradle for my spring boot project. Everything seems to work but here is where I am stuck. I have 2 properties file. One for prod i.e.: </p>

<blockquote>
  <p>application_prod.properties</p>
</blockquote>

<p>and another for qa i.e.:</p>

<blockquote>
  <p>application_qa.properties</p>
</blockquote>

<p>My requirement is such that while I build (create jar file) the project from gradle, I've to rename the properties file to </p>

<blockquote>
  <p>application.properties</p>
</blockquote>

<p>and then build the jar file. As far as I know, gradle has a default build task. So here I've to override it such that it considers only the required properties file and rename it and then build depending on the environment. </p>

<p>How can I achieve this?</p>