0

My company's admin team have introduced a new restriction on Nexus repository where they do not allow update on same artifact version again. My project has 7 sub-modules (say m1..m7) where all have different versions. They all are independent and kept in the same project to manage them better. Now after this restriction activated, if any of the module's version pre-exist in Nexus, the whole build fails with

"Return code is: 400, ReasonPhrase: Repository does not allow updating assets"

I am OK with that artifact not uploading to Nexus but I want other modules to still carry on uploading. If I made a change to one module (say m4), I want m4 to upload with the new version that I specified but other modules can try the upload and fail. Or maybe skip the upload automatically by checking if the module's version already exists.

I have searched a lot but couldn't find any way to achieve this apart from driving all modules with the same version. Here, I use maven properties to enforce the same version on all submodules, and now even if I make changes in one module, all modules are uploaded to Nexus.

Is there any cleaner way to achieve this like ignoring specific errors from Nexus or check for the existing version and skip upload?

Akhil
  • 533
  • 2
  • 11
  • 26

1 Answers1

0

The clean thing is to increase the version (automatically) directly after a release, so if you have build a version 1.0.0, the version in the POM should be changed to 1.0.1-SNAPSHOT.

This way you avoid most problems arising from accidentally releasing things twice.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142