Maven ssh deployment overrides artifacts in nexus - Can this be prevented?

665 Views Asked by At

we are using the Maven Wagon SSH and Wagon SSH External plugins to deploy to our nexus repository. This way artifacts in the nexus can be overridden.

Is there a way to prevent this on the maven side? Or do we have to change either the wagon or the file system permissions for the artifacts?

1

There are 1 best solutions below

4
On

I would suggest you to use the deploy command or use maven-release-plugin. With the plugin you can prepare your pom.xml to next version and it will commit these changes to your version control (git,svn). Then you can run perform command to build prepared version and deploy it into the nexus.

The point is you can re-deploy your working snapshot version (that ends with -SNAPSHOT) as much as you want. But you can deploy version WITHOUT snapshot only once. That ensures you the release version wont be overridden this way!

The problem is you have to update your version manually or you will use that mentioned plugin.