Copy an artifact from jenkins to another server with new name

varesa picture varesa · Sep 18, 2012 · Viewed 20k times · Source

I have a few jobs that automatically build a java app. I would like it to automatically push it to a other server. I found a plugin that copies artifacts over ssh, but using it I end up with app-1.0-SNAPHSHOT.jar, app-1.1-SNAPHSHOT.jar and so on on the remote server.

I would like to have it as app.jar instead, overwriting the old one every time. Is there a "intelligent" way of doing this, or should I just make a shell script that looks for the newest one, and overwrites it?

Answer

Stephen Connolly picture Stephen Connolly · Sep 19, 2012

If you are using a Maven project I would recommend Mojo's Ship Maven Plugin for doing the transfer via your build scripts.

If you want to do this via Jenkins plugins, there are the following plugin options: