How to release a project that depends on a third-party SNAPSHOT project in maven

I would like to release the "foo-1.0-SNAPSHOT" snapshot project using the maven release plugin. The project depends on the third-party module "bar-1.0-SNAPSHOT", which has not yet been released. I use the 'allowTimestampedSnapshots' option in my pom.xml project to allow snapshots, but I assume that the third-party module (panel) is not marked timestamped unless I built it myself, because maven still complains about unresolved SNAPSHOT dependencies.

Is there a way to release the foo project regardless of the dependent SNAPSHOT projects, and if not, how can I add a timestamp for a third-party project?

+44
maven-2 versioning release maven-release-plugin snapshot
Oct 29 '08 at 6:04
source share
5 answers

See the following answer for a short answer .... long answer: you can get around it.

The only way I've dealt with in the past is to effectively develop a third-party library and cut the release myself. This, of course, is easier said than done, and simply difficult if the library is large, complex and impossible, if the library of third-party developers is closed. A simpler way is perhaps to approach a third party and ask them to cut the release.

Another option would be to copy your pom (make sure it does not have snapshots) changed the version information and manually set the pom and artifact in your repository.

+7
Oct 31 '08 at 17:26
source share
β€” -

The problem is the parameter name allowTimestampedSnapshots , this is in the documentation, but the plugin source uses a different parameter name in the expression - ignoreSnapshots .

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

+138
Oct 18 2018-10-18
source share

Using the maven-release-plugin option

 -DignoreSnapshots=true 

instead

 -DallowTimestampedSnapshots=true 

helped in my case, this will allow using dependencies with the snapshot to prepare and execute the release.

This parameter should be handled very carefully, because using versions of snapshots in a release can subsequently break your version if the snapshot dependency is updated, which in the usual case is not what you want.

+12
May 11 '11 at 12:26
source share

The previous answer suggested changing the identifier of the group and artifact ... do not do this, since maven will not recognize it as the same artifact later, when this dependency is released, and you get two copies on the class path, My preferred method is to change only the version, and I will do something like: [original version] - [my name is org] - [svn version I pulled out), so I get something like 1.0-SONATYPE-3425. Using svn rev, I can always pull out the source and fix it if necessary, and know exactly what I'm using without pulling the entire source into my own svn.

Update - I blogged about this a while ago.

+6
Nov 08 '08 at 16:26
source share

Just install the can with the pump. I generally change the identifier of the group and artifact so that it is clear that this is not an official version, but, as a rule, is best suited to your problem.

-2
Oct. 31 '08 at 21:27
source share



All Articles