0

I am building a project in a pipeline. I am getting Build Failure Error: Can't release the project due to non-released dependencies.

Multi-module java project using Maven as the Build tool and Nexus as repository manager in Jenkins pipeline.

When the artifact named as -SNAPSHOT, I was able to build a snapshot, generate war file, upload it to Nexus but during the next cycle in the Build phase, it fails with the error: Can't release the project due to non-released dependencies. I don't have any control over the scripts/steps in the pipeline.

hawk base
  • 21
  • 3
  • 10
  • 1
    If you build a release you should not have any SNAPSHOTS versions in your POMs. Maven will prevent the release otherwise. You might want to find the SNAPSHOT dependencies and find who is responsible for those releases. Do you update your project to a non SNAPSHOT version with the versions plugin? – Sebastian Aug 20 '19 at 07:29
  • If I use the version as 1.0.0-SNAPSHOT and the library dependencies without SNAPSHOT, its giving compilation time errors. If I make the artifact as 1.0.0 without SNAPSHOT and the library dependencies with SNAPSHOT, it fails in the SNAPSHOT cycle citing that it doesn't allow 1.0.0 during the SNAPSHOT cycle. – hawk base Aug 20 '19 at 09:35
  • That means that there are no released versions of the library you are using. As stated here: https://stackoverflow.com/a/3959507/3266467 you can use `-DignoreSnapshots=true` in the `release:prepare` phase to work around this but it is not really clean to do this. – Sebastian Aug 20 '19 at 09:41
  • Thanks for the reply. It’s a pipeline. Can you please elaborate in detail as how to make ignoreSnapshots to set to true – hawk base Aug 20 '19 at 15:08
  • I can't ignore snapshots to set to true as it's a pipeline. If the pipeline refers to the released dependencies the problem is solved. – hawk base Aug 21 '19 at 00:55

0 Answers0