You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sony Antony <so...@gmail.com> on 2009/12/04 02:14:28 UTC

Possible to specify version from a properties file

We have more than 100 modules in our project.
Each pom includes teh parent pom using the cordinates including teh version
number.

Is there any way to centralize the version number, maybe in a properties
file/profile/something.
So that if the version changes, this will be the only place where we need to
change the version.
( Every pom would refer to this version number using some kind of
indirection - like ${project.version} )

We would liek to avoid having to put the version number in every pom.

--sony

Re: Possible to specify version from a properties file

Posted by Anders Hammar <an...@hammar.net>.
For Maven 2.x you need to specify the parent's version. For Maven 3 that
will change I believe. Not sure if it is already done i 3.0 (alpha).
You can read about this in Jason's blog post (under 'Responding to … being
completely wrong'):
http://www.sonatype.com/people/2009/11/maven-3x-paving-the-desire-lines-part-one-2/

/Anders

On Fri, Dec 4, 2009 at 02:14, Sony Antony <so...@gmail.com> wrote:

> We have more than 100 modules in our project.
> Each pom includes teh parent pom using the cordinates including teh version
> number.
>
> Is there any way to centralize the version number, maybe in a properties
> file/profile/something.
> So that if the version changes, this will be the only place where we need
> to
> change the version.
> ( Every pom would refer to this version number using some kind of
> indirection - like ${project.version} )
>
> We would liek to avoid having to put the version number in every pom.
>
> --sony
>

Re: Possible to specify version from a properties file

Posted by Stevo Slavić <ss...@gmail.com>.
AFAIK maven2 when processing module pom before anything else first resolves
any parent reference, so parent version has to be specified explicitly. To
have parent version explicitly specified and to easily update it,
maybe this<http://mojo.codehaus.org/versions-maven-plugin/examples/update-parent.html>will
work for you.

Regards,
Stevo.

On Fri, Dec 4, 2009 at 2:14 AM, Sony Antony <so...@gmail.com> wrote:

> We have more than 100 modules in our project.
> Each pom includes teh parent pom using the cordinates including teh version
> number.
>
> Is there any way to centralize the version number, maybe in a properties
> file/profile/something.
> So that if the version changes, this will be the only place where we need
> to
> change the version.
> ( Every pom would refer to this version number using some kind of
> indirection - like ${project.version} )
>
> We would liek to avoid having to put the version number in every pom.
>
> --sony
>