You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Van Steenberghe Mario (GFDI)" <Ma...@gfdi.be> on 2005/08/08 17:00:48 UTC

[m2] how to specify build version through property

Hello,

 

I'm trying to setup a build using maven2, but I can't seem to find a
solution to dynamically specify a project version in the POM, which was
possible in maven1 by using a property file.

 

  <modelVersion>4.0.0</modelVersion>

  <groupId>fwk2</groupId>

  <artifactId>fwk_client</artifactId>

  <version>${project.version}</version>

  <packaging>jar</packaging>

 

Is there anyone who knows how this should be done in maven2 ?

 

Thanks,

Mario.


Re: [m2] how to specify build version through property

Posted by dan tran <da...@gmail.com>.
trygve,

I have a requirement in my nightly build to using the same version number
( we increamented every night) for subprojects.  In M1, we have a
global version property that all sub proeject refer to get the version
includoing the dependencies's version

>From your suggestion, i hope in dependencyManagement, we dont have to do 
alot of work in that session like listing all possible dependencies 

Thanks

-Dan




On 8/8/05, Trygve Laugstøl <tr...@codehaus.org> wrote:
> On Mon, Aug 08, 2005 at 05:00:48PM +0200, Van Steenberghe Mario (GFDI) wrote:
> > Hello,
> >
> >
> >
> > I'm trying to setup a build using maven2, but I can't seem to find a
> > solution to dynamically specify a project version in the POM, which was
> > possible in maven1 by using a property file.
> >
> >
> >
> >   <modelVersion>4.0.0</modelVersion>
> >
> >   <groupId>fwk2</groupId>
> >
> >   <artifactId>fwk_client</artifactId>
> >
> >   <version>${project.version}</version>
> >
> >   <packaging>jar</packaging>
> >
> >
> >
> > Is there anyone who knows how this should be done in maven2 ?
> 
> When is this useful? If you are trying to centralize version management
> there are two useful features that you can use:
> 
>  o When inheriting from a parent you don't have to specify the version in
>   your POM. It will be inherited from the parent. Now that doesn't make
>   it a whole lot easier but we're working on improving the way you
>   specify the parent.
> 
>  o Use <dependencyManagement> in your root pom to control the version of
>   your dependencies from a single point. There seems to be lacking some
>   docs on that, I'll try to write something there.
> 
>   As a example you can take a look at [1] for a <dependencyManagement>
>   example and in [2] you can see <dependency> without a <version>
>   element.
> 
> [1]: http://svn.apache.org/viewcvs.cgi/*checkout*/maven/continuum/tags/continuum-1.0-alpha-3/pom.xml?rev=210197&content-type=text%2Fplain
> [2]: http://svn.apache.org/viewcvs.cgi/*checkout*/maven/continuum/tags/continuum-1.0-alpha-3/continuum-core/pom.xml?rev=210197&content-type=text%2Fplain
> 
> --
> Trygve
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> 
> iD8DBQFC93gX4EbM92cyCUURAmznAKDJ2We8Yz56OvnsgndadfCd97ZJ8gCffdaJ
> PEevuYqILadF2K6gqTgArSU=
> =V9yK
> -----END PGP SIGNATURE-----
> 
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] how to specify build version through property

Posted by Trygve Laugstøl <tr...@codehaus.org>.
On Mon, Aug 08, 2005 at 05:00:48PM +0200, Van Steenberghe Mario (GFDI) wrote:
> Hello,
> 
>  
> 
> I'm trying to setup a build using maven2, but I can't seem to find a
> solution to dynamically specify a project version in the POM, which was
> possible in maven1 by using a property file.
> 
>  
> 
>   <modelVersion>4.0.0</modelVersion>
> 
>   <groupId>fwk2</groupId>
> 
>   <artifactId>fwk_client</artifactId>
> 
>   <version>${project.version}</version>
> 
>   <packaging>jar</packaging>
> 
>  
> 
> Is there anyone who knows how this should be done in maven2 ?

When is this useful? If you are trying to centralize version management
there are two useful features that you can use:

 o When inheriting from a parent you don't have to specify the version in
   your POM. It will be inherited from the parent. Now that doesn't make
   it a whole lot easier but we're working on improving the way you
   specify the parent.

 o Use <dependencyManagement> in your root pom to control the version of
   your dependencies from a single point. There seems to be lacking some
   docs on that, I'll try to write something there.

   As a example you can take a look at [1] for a <dependencyManagement>
   example and in [2] you can see <dependency> without a <version>
   element.

[1]: http://svn.apache.org/viewcvs.cgi/*checkout*/maven/continuum/tags/continuum-1.0-alpha-3/pom.xml?rev=210197&content-type=text%2Fplain
[2]: http://svn.apache.org/viewcvs.cgi/*checkout*/maven/continuum/tags/continuum-1.0-alpha-3/continuum-core/pom.xml?rev=210197&content-type=text%2Fplain

--
Trygve