+1 with Stephen We faced the problem with release plugin and, since then, are "hard coding" version in the artefacts.
Frederic On Wed, Dec 9, 2009 at 9:03 AM, Stephen Connolly < [email protected]> wrote: > AFAIK using ${project.versopm} is not the preferred way. The release > plugin > will update all those versions for you so that you don't have to use > ${project.version}. If you use ${project.version} then releases will be > slower AFAIK due to some strange resolving issue! > > The use of properties for specifying versions in dependencies is usually > when you want to lock a suite of dependencies (built externally to your > reactor) to the same version, e.g. > > <properties> > <jetty-version>6.1.20</jetty-version> > </properties> > > <dependencies> > <dependency> > <groupId>org.mortbay.jetty</groupId> > <artifactId>jetty</artifactId> > <version>${jetty-version}</version> > </dependency> > > <dependency> > <groupId>org.mortbay.jetty</groupId> > <artifactId>jetty-management</artifactId> > <version>${jetty-version}</version> > </dependency> > > <dependency> > <groupId>org.mortbay.jetty</groupId> > <artifactId>jetty-naming</artifactId> > <version>${jetty-version}</version> > </dependency> > > <dependency> > <groupId>org.mortbay.jetty</groupId> > <artifactId>jetty-plus</artifactId> > <version>${jetty-version}</version> > </dependency> > > <dependency> > <groupId>org.mortbay.jetty</groupId> > <artifactId>jetty-util</artifactId> > <version>${jetty-version}</version> > </dependency> > </dependencies> > > in the above example, a property is the only way to ensure that all the > dependencies are tied to the same version. In addition, if you have a pom > with such a set of dependencies / dependencyManagement and the property is > defined in the same pom.xml, then versions:update-properties becomes very > handy > > -Stephen > > 2009/12/9 Baptiste MATHUS <[email protected]> > > > And by the way, using variables for specifying dependencies versions > > perfectly work out of the box with maven2. > > > > For example, we have a whole project hierarchy of 20+ modules that all > have > > the same version. Each module always references the parent version since > it > > must be there. But it doesn't have its own <version> tag, or even > > <groupId>. > > And referencing between modules is then just done by the standard > variable > > ${project.version}. > > > > FWIW. > > Cheers. > > > > 2009/12/9 Paul Benedict <[email protected]> > > > > > Dana, just to clarify, he was asking about variables in dependencies. > > > I don't think the parent is considered a <dependency> in the technical > > > sense that Maven uses. > > > > > > On Tue, Dec 8, 2009 at 6:40 PM, Lacoste, Dana (TSG Software San Diego) > > > <[email protected]> wrote: > > > > No, with maven 2 you cannot have a variable in the parent version. > The > > > string will be interpreted literally without dereferencing the variable > > > name. > > > > > > > > Similarly, you can't have an empty version number: the parent MUST > have > > a > > > defined version number and it MUST be absolute and not contain any > > > variables. > > > > > > > > variables work fine in any other version number, however. ranges, on > > the > > > other hand, do not ;) > > > > > > > > Dana Lacoste > > > > > > > > -----Original Message----- > > > > From: [email protected] [mailto: > [email protected]] > > > On Behalf Of Paul Benedict > > > > Sent: Tuesday, December 08, 2009 4:37 PM > > > > To: Maven Users List > > > > Subject: Re: maven 3 inheritance > > > > > > > >> ...and parent versions? > > > > > > > > Good question. You'll have to find out if the project hierarchy or > > > > dependency resolution is processed first. Report back and tell us! > > > > > > > > Paul > > > > > > > > --------------------------------------------------------------------- > > > > 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] > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [email protected] > > > For additional commands, e-mail: [email protected] > > > > > > > > > > > > -- > > Baptiste <Batmat> MATHUS - http://batmat.net > > Sauvez un arbre, > > Mangez un castor ! > > >
