You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stanley Lee <ma...@gmail.com> on 2008/05/16 17:41:11 UTC

Use property for dependency artifact version

Hi,

I have two projects: projectA and projectB, projectB depends projectA. In
Release, I want to increase their version together. So I define the version
as property "project.release.version" and set it in pom.xml.

After the build, I see projectA-6.0.0.jar and projectB-6.0.0.war. But in
projectB-6.0.0.war, it contains file
"projectA-${project.release.version}.jar". More than that, in repository, I
see projectA and projectB are generated under folder
"${project.release.version}".

Am I misunderstanding anything? Does Maven2 support property as version for
dependency? Many thanks!

Stan

Re: Use property for dependency artifact version

Posted by Stanley Lee <ma...@gmail.com>.
Thanks for suggestion!

I found my problem: shouldn't use a variable like "project.release.version".
Maven must try to look that value under <project> node. When I replace with
a uncommon name like "fancyBuild.version", then everything works as
expected.


On Fri, May 16, 2008 at 1:12 PM, Clifton <cl...@gmail.com> wrote:

>
> You want to use the release plugin with a multi module project. Setup a
> super
> pom with packaging = pom and artifactId set to whatever (eg. artifactId:
> MyProj) and include projects A and B as sub modules. When your ready to cut
> a release just run
> mvn release:prepare release:perform
> on the cmd line and the plugin takes care of all your dirty work,
> incrementing your version numbers automatically creating tags in VCS
> resolving the pom including the version of everything involved in the build
> checking in the resolved pom and more. Read the "Better Builds With Maven"
> PDF freely available on line to get more detail about the release plugin.
> Trust me, using anything less will only complicate your project management.
>
>

Re: Use property for dependency artifact version

Posted by Clifton <cl...@gmail.com>.
You want to use the release plugin with a multi module project. Setup a super
pom with packaging = pom and artifactId set to whatever (eg. artifactId:
MyProj) and include projects A and B as sub modules. When your ready to cut
a release just run 
mvn release:prepare release:perform 
on the cmd line and the plugin takes care of all your dirty work,
incrementing your version numbers automatically creating tags in VCS
resolving the pom including the version of everything involved in the build
checking in the resolved pom and more. Read the "Better Builds With Maven"
PDF freely available on line to get more detail about the release plugin.
Trust me, using anything less will only complicate your project management.


Stanley Lee-3 wrote:
> 
> Hi,
> 
> I have two projects: projectA and projectB, projectB depends projectA. In
> Release, I want to increase their version together. So I define the
> version
> as property "project.release.version" and set it in pom.xml.
> 
> After the build, I see projectA-6.0.0.jar and projectB-6.0.0.war. But in
> projectB-6.0.0.war, it contains file
> "projectA-${project.release.version}.jar". More than that, in repository,
> I
> see projectA and projectB are generated under folder
> "${project.release.version}".
> 
> Am I misunderstanding anything? Does Maven2 support property as version
> for
> dependency? Many thanks!
> 
> Stan
> 
> 

-- 
View this message in context: http://www.nabble.com/Use-property-for-dependency-artifact-version-tp17277869p17279852.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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