Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to release a project which depends on a 3rd party SNAPSHOT project in maven

i would like to release a snapshot project 'foo-1.0-SNAPSHOT' using the maven release plugin. The project depends on a 3rd party module 'bar-1.0-SNAPSHOT' which is not released yet. I use the option 'allowTimestampedSnapshots' in my project's pom.xml to allow timestamped snapshots but i assume that the 3rd party module (bar) is not timestamped unless i build it myself as maven still complains about unresolved SNAPSHOT dependencies.

Is there a way to release the project foo regardless of dependent SNAPSHOT projects and if not how could i add a timestamp to the 3rd party project?

like image 746
Christian Avatar asked Oct 29 '08 06:10

Christian


People also ask

Why is it best practice not to release snapshots of Maven?

Rule #3 Never release using the Time-Stamped snapshot The release plugin will still fail if you do this because it correctly understands you have SNAPSHOT dependencies. The plugin has a flag to allow bypass this check and people unfortunately use it far too often.

What is the difference between snapshot and release in Maven?

A "release" is the final build for a version which does not change. A "snapshot" is a build which can be replaced by another build which has the same name. It implies that the build could change at any time and is still under active development.

What is the difference between a snapshot and a release?

By definition, snapshots are mutable, releases are immutable. This is why Nexus makes you store them separately because usually you don't care if you lose snapshots, but you will care if you lose releases. It makes snapshot cleanup much easier to deal with that way.


1 Answers

Problem is with the allowTimestampedSnapshots parameter name, it's in the documentation but the plugin's source uses a different parameter name in expression - ignoreSnapshots.

So just use -DignoreSnapshots=true and the prepare goal of the release plugin will ignore snapshot dependencies.

like image 59
Stevo Slavić Avatar answered Sep 24 '22 04:09

Stevo Slavić