This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Can't release the project due to non-released dependencies

 
Greenhorn
Posts: 10
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 10749
229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure this is a Maven issue. Your pipeline is probably set up that it refuses to release artifacts that have a dependency on pre-release artifacts. You probably have to create full release versions of your dependencies before you can release the dependent artifact.

I think you have to talk to your DevOps person for more info. MAYBE we can help you some more if you show us your POM?
 
David Shawn
Greenhorn
Posts: 10
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

1) . If I use the version as 1.0.0-SNAPSHOT and the library dependencies without SNAPSHOT, its giving compilation time errors

2) 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

3) If I use the version as 1.0.0-SNAPSHOT and the library dependencies with SNAPSHOT, its failing in the RELEASE cycle.

4) I have updated the dependency jars to 1.0.0 without SNAPSHOT and uploaded it manually to Nexus 2 , but its talking only the SNAPSHOT version.

5) I dont have access to Internet in my company but POM is simple. Its a multi module. Parent Pom refers to only one module of Child Pom. Local build is successful.
 
Stephan van Hulst
Saloon Keeper
Posts: 10749
229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what you mean by "SHAPSHOT cycle" and what you mean by "RELEASE cycle". Are these phases in Jenkins' release pipeline?

Do you have profiles configured in your POMs? Again, we can't do much to help if you if you don't show us your POMs. The devil is often in the details, and even a "simple parent POM" can harbor tricky gotchas.

Also, have you spoken to DevOps about Jenkins yet?
 
Saloon Keeper
Posts: 21233
137
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:I don't know what you mean by "SHAPSHOT cycle" and what you mean by "RELEASE cycle". Are these phases in Jenkins' release pipeline?



Maven has the ability to create SNAPSHOT versions of a build. These can then be posted to a shared repository such as Nexus and there are special management functions. SNAPSHOT versions are essentially informal incomplete editions of their corresponding formal release versions. They're productivity sugar.

I'm not sure what "releasing" in Jenkins means, though.
 
Stephan van Hulst
Saloon Keeper
Posts: 10749
229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To clarify, I know about SNAPSHOT versions, but I don't know what OP means by "SNAPSHOT cycle".
 
Tim Holloway
Saloon Keeper
Posts: 21233
137
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:To clarify, I know about SNAPSHOT versions, but I don't know what OP means by "SNAPSHOT cycle".



I'm taking that to mean that "SNAPSHOT cycle" means development, as opposed to production builds.

I took a quick peek at one of my snapshot-based POMs. Without actually carefully reading David's problem   I would venture that he's trying to do a production build that's pulling in SNAPSHOT dependencies. And that's not something one should be doing. A snapshot should be able to pull in production artefacts (hard to do anything if you can't do that with the Apache libraries, for example!). But a production module should not be pulling in "experimental" code.
 
David Shawn
Greenhorn
Posts: 10
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies. Sorry about the confusion with regard to the terms SNAPSHOTS and SNAPSHOT Cycle

The Project is built on the pipeline. There are three cycles: Git Cycle , Jenkins Cycle and Deployment Cycle.

Jenkins Cycle: This is often called as SNAPSHOT cycle. As it build a snapshot of the artifact. During this cycle, Maven build the project.

Deployment Cycle: This is called as Release Cycle. During this cycle, it creates a secure and steady artifact from the SNAPSHOT artifact. This is called as Release Cycle.

In the Nexus there are two repositories - Called as SNAPSHOTS and RELEASES. In the snapshots repositories, the dependencies of SNAPSHOTS are stored and in the Releases repository, the Relased dependencies are stored. Snapshots are considered to be unstable, dev build. Releases are considered to be steady builds.

With regard to Jenkins, it's a pipeline and other builds are able to refer to the release as well as to the snapshot dependencies. I do have only restricted access to the Internet and thereby, I can't post the POM.

When the build is getting triggered in the pipeline, the pipeline were able to build only by referring it to the SNAPSHOT dependencies versions and not the Released dependencies versions.


When I refer to the SNAPSHOT dependencies, it builds artifact-SNAPSHOT with the SNAPSHOT dependencies and during the Deployment (Release cycle), it fails in the build citing "Can't release the project to non released dependencies"

The repositories been mentioned correctly same as the other project. Why the pipeline not able to refer the non-snapshot dependencies whereas it successfully build the war file when it refers to the snapshot dependencies?


Local build is successful only if the dependencies version are named as version-SNAPSHOT and build fails if named as version alone. Both the version-SNAPSHOT dependencies and version-withoutSNAPSHOT dependenices are available on Nexus.
 
Stephan van Hulst
Saloon Keeper
Posts: 10749
229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way you can share the error message you get when building locally against non-snapshot dependencies? This is where the issue seems to be.

The case where Jenkins fails to create a release when using snapshot dependencies makes sense. You really don't want to do that and it's protecting you.
 
Tim Holloway
Saloon Keeper
Posts: 21233
137
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing that is REALLY confusing is the way you say "the project is built on the pipeline" and your "cycles", especially the "Jenkins" cycle. Your terminology doesn't match common usage.

What I'd be expecting to see normally is that you'd have possibly 2 build processes: manual build (where you run Maven from IDE or command line) and Jenkins build (usable to build testing and production releases). In other words, Jenkins not a "cycle", but the Build Controller. I'd also expect that essentially the same Maven POMs would serve whether you're building manually or via Jenkins.

Jenkins itself runs as a pipeline of sorts. I don't know that I'd use that term, since a pipeline is normally used to transport something, and what you really have in Jenkins is a sequence of processing steps. You can arrange those steps to do git pull/compile/build with deployment being a separate Jenkins sequence or you can do a pull/compile/build/deploy as a single sequence.

In any event, it really does sound like Jenkins has nothing to do with the problem at hand. If you really are trying to pull SNAPSHOT modules into non-SNAPSHOT builds, Maven is probably objecting to that. With good reason.
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!