In fact we're triggering our builds from a user interface, where the user is 
allowed to specify the project version he wishes to build. This property must 
then be passed on to the build mechanism to produce the correct version.

We could probably get around this problem by generating the POMs and by using 
some place holders for the version in the templates, but this doesn't seem to 
be a better solution than setting directly the property name in the POM as we 
could do in maven 1.

Also, for the dependency mechanism, why do we need to use inheritance to 
specify the dependency versions ? Wouldn't it be better to use an 'include' 
tag, which allows you to include a POM from the repository, which holds a set 
of dependencies. This way, it would be possible to easily switch between 
different sets of dependencies, or split of the dependency list over a number 
of smaller POMs, grouping similar libraries as such.


-----Original Message-----
From: Trygve Laugstøl [mailto:[EMAIL PROTECTED] 
Sent: maandag 8 augustus 2005 17:20
To: Maven Users List
Subject: Re: [m2] how to specify build version through property

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to