Question

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?

Was it helpful?

Solution

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:

OTHER TIPS

I just do it right in my build scripts. Why all the extra management? In ant,

<copy todir="${remote}"> 
    <globmapper from="*" to="app.jar"/>
    ...
</copy>

works perfectly fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top