2

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?

BlackEye
  • 775
  • 11
  • 25
  • 1
    Why are you using SSH ? I assume you using ssh on the file system level onto your Nexus. SSH is not the way to upload artifacts to Nexus. Use default http(s) to upload artifacts and you can control to overwrite existing artifacts (releases) in particular. – khmarbaise May 19 '15 at 09:59

1 Answers1

0

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.

Milan Baran
  • 4,133
  • 2
  • 32
  • 49
  • By "deploy command" you meen the deploy plugin? Wouldn't deploying via the maven-release-plugin also use the maven deploy plugin? – BlackEye May 19 '15 at 11:18
  • Yea, i meant that standard deploy command, which is provided by maven-deploy-plugin probably. Yes, `perform` action will use the `deploy` command from another plugin. Basically, the release plugin manage versions of you pom.xml, when you have bigger sub-module projects, it gets harder to maintain it manually. – Milan Baran May 19 '15 at 11:25
  • And the deploy-plugin then uses the maven wagon. So we are in fact using the deploy-plugin. The problem is, that you CAN deploy a version WITHOUT snapshot as often as you "want". – BlackEye May 19 '15 at 11:29
  • I don't think this answer the original question of restricting re-deploy while using ssh for maven deployment. I also am facing the same issue where ssh is able re-deploy the release versions as well and that's a considerable risk to run into. – Arnab Dec 11 '20 at 15:06