title: Versioning Using Maven and Jenkins
body: <p>I have come across a slight problem in the setup that I have developed and was hoping for some advice on my release procedure.</p>
  
  <p>As it stands, I use my development box to build with jenkins / maven. To build my application I created a delivery pipeline which looks as follows</p>
  
  <p><img src="https://i.stack.imgur.com/iQFWT.png" alt="enter image description here"></p>
  
  <p>Every time my application is built, it uses the name appname-1.0.war and I have seen that using the maven release plugin ( <a href="https://stackoverflow.com/questions/9554688/maven-versioning-best-practices">Maven versioning best practices</a> ) we can get maven to increment the build number.</p>
  
  <p>My issue however is this;</p>
  
  <p>My prod build in the pipeline essentially builds the application with prod profiles on dev, when built, scp's the file to prod and then deploys to the relevant directory.</p>
  
  <p>1) This therefore overwrites an existing application with the same name</p>
  
  <p>2) If i use maven release plugin the filename will always be changing, so how can I scp the correct file if i don't know its name in advance?</p>
  
  <p>Hopefully I have given enough details of the issue I face as I really would like a mechanism that allows me on production to roll back to a previous release as currently this is not possible.</p>
  
  <p>Thanks</p>