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

Attachment: signature.asc
Description: Digital signature

Reply via email to