We don't use ${project.version}. Sub-modules never specify their own
version, they are all specified in the dependencyManagement section of the
master with a straight-up version string. We use autoVersionSubModules and
most of the time we release automatically with mvn -B release:prepare
release:perform. That said, we use preparationGoal install because we use
the dependency plugin to copy some native libraries. I perfectly understand
the desire of the release not to to run "install" by default, but polluting
local repository is not that problematic because typically, you'll just fix
the problems and re-run the release from the same machine until it succeeds.
Polluting the deployment repository is of course a big deal, and at least
for us it means we automatically abandon that release and just do a new one.Kalle On Thu, Mar 5, 2009 at 10:17 AM, Todd Thiessen <[email protected]> wrote: > Here is the reference. > > > http://www.sonatype.com/books/maven-book/reference/optimizing-sect-final-poms.html > > --- > Todd Thiessen > > > > -----Original Message----- > > From: Thiessen, Todd (BVW:9T16) > > Sent: Thursday, March 05, 2009 1:17 PM > > To: 'Maven Users List' > > Subject: RE: RE: RE: Re: release:prepare cannot find artifacts > > > > Ok. This is not what is recommended in the definitive guide > > though. It is very clear in the optimzing POM section that > > ${project.version} should be used when referencing sibling projects. > > > > > > --- > > Todd Thiessen > > > > > > > -----Original Message----- > > > From: news [mailto:[email protected]] On Behalf Of Jörg Schaible > > > Sent: Thursday, March 05, 2009 1:14 PM > > > To: [email protected] > > > Subject: RE: RE: Re: release:prepare cannot find artifacts > > > > > > Hi Todd, > > > > > > Todd Thiessen wrote at Donnerstag, 5. März 2009 16:21: > > > > > > > > > > >> > Getting back to the issue at hand though, what is the > > > proper way in > > > >> > Maven to do a build with the release plugin when you have > > > >> dependencies > > > >> > between modules? Are you supposed to do something with the > > > >> dependency > > > >> > plugin to ensure that dependencies get properly resolved > > > during the > > > >> > prepare? > > > >> > > > >> Use the proper version strings for all artifacts that are > > > part of the > > > >> multi-project, not properties, and let the release plugin handle > > > >> this. > > > > > > > > Perhaps you are referring to something I am not familiar > > > with but I am > > > > doing all that. All module projects have the proper > > > version. In this > > > > case ${project.version}. > > > > > > > > However, when you have dependencies between modules, the release > > > > prepare will fail by default since it doesn't do an > > > install. Without > > > > an install, one module doesn't have access to the artifacts > > > of another. > > > > > > Exactly, therefore you should not use ${project.version} at all, > > > because during release the value is simply wrong. > > > However, in this case release plugin cannot adjust the > > value, because > > > it is "hiding". > > > > > > Working approach is: > > > > > > Parent POM: > > > =========== > > > ... > > > <groupId>group</groupId> > > > <artifactId>parent</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > ... > > > <dependencyManagement> > > > <dependencies> > > > <dependency> > > > <groupId>group</groupId> > > > <artifactId>childA</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > </dependency> > > > <dependency> > > > <groupId>group</groupId> > > > <artifactId>childB</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > </dependency> > > > </dependencies> > > > </dependencyManagement> > > > > > > > > > ChildA POM: > > > =========== > > > <parent> > > > <groupId>group</groupId> > > > <artifactId>parent</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > </parent> > > > <artifactId>childA</artifactId> > > > ... > > > > > > ChildB POM: > > > =========== > > > <parent> > > > <groupId>group</groupId> > > > <artifactId>parent</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > </parent> > > > <artifactId>childB</artifactId> > > > ... > > > <dependencies> > > > <dependency> > > > <groupId>group</groupId> > > > <artifactId>childA</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > </dependency> > > > </dependencies> > > > > > > > > > All those version strings will automatically adjusted. > > > > > > - Jörg > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [email protected] > > > For additional commands, e-mail: [email protected] > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
