You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jared Blitzstein <ma...@blitzstein.net> on 2007/05/02 22:35:53 UTC

Multi-module passing properties to children

I have 5 projects that I want to build as a suite.  I created a multi- 
module to do this and it's fine out of the box for just calling the  
sub projects. But I need to be able to set variables in the multi- 
module to pass in like the version, profile, and some other basic  
things. But I also need to make sure each of these projects can live  
on their own. I've read http://www.sonatype.com/book/pom- 
relationships.html as well as the getting-started on mavens website  
but they don't speak to what I'm trying to do. Can anyone point me in  
the right direction?

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


Re: Multi-module passing properties to children

Posted by Roland Asmann <Ro...@cfc.at>.
If you include a <parent>-tag for your parent-POM, your project automatically 
inherits its version (unless you set it manually).
In case you need to reference it in other places as well, try using 
${parent.version}


On Thursday 03 May 2007 01:04, Jared Blitzstein wrote:
> Does using the parent tag require the project to be in a repository?
> I planned on having this "suitepom" accessible via CVS but not
> something that is going to be installed in our company repo. I may be
> way off base though.
>
> Also, how would you pass something through like a version? The
> version tag is required in the child pom so you can't leave it out,
> and if I do ${version} it doesn't pick that up from the definition in
> the master pom, it just uses "${version}" literally.
>

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

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


RE: Multi-module passing properties to children

Posted by "Balasubramanian, Ravi Shankar" <rb...@informatica.com>.
Hi,
The master pom in this case need not be installed in the repository. You
can use the relativePath element under the parent tag to point to your
master pom. Something like as follows:
<parent>
<groupId>...</groupId>
<artifactId>..</artifactId>
<relativePath>../(CORRECT_RELATIVE_PATH_TO_WHERE_YOUR_MASTER_POM_EXISTS<
/relativePath>
</parent>

This does not require that your parent pom be installed in the
repository.



-----Original Message-----
From: Jared Blitzstein [mailto:mailing-list@blitzstein.net] 
Sent: Thursday, May 03, 2007 4:34 AM
To: Maven Users List
Subject: Re: Multi-module passing properties to children

Does using the parent tag require the project to be in a repository?  
I planned on having this "suitepom" accessible via CVS but not  
something that is going to be installed in our company repo. I may be  
way off base though.

Also, how would you pass something through like a version? The  
version tag is required in the child pom so you can't leave it out,  
and if I do ${version} it doesn't pick that up from the definition in  
the master pom, it just uses "${version}" literally.

On May 2, 2007, at 5:17 PM, Wayne Fay wrote:

> Put the shared properties in profiles in the parent pom, include the
> children as <modules/> in the parent pom, and use the parent tag in
> the children to share properties with all your poms.
>
> Or is there a specific reason this is not sufficient?
>
> Wayne
>
> On 5/2/07, Jared Blitzstein <ma...@blitzstein.net> wrote:
>> I have 5 projects that I want to build as a suite.  I created a  
>> multi-
>> module to do this and it's fine out of the box for just calling the
>> sub projects. But I need to be able to set variables in the multi-
>> module to pass in like the version, profile, and some other basic
>> things. But I also need to make sure each of these projects can live
>> on their own. I've read http://www.sonatype.com/book/pom-
>> relationships.html as well as the getting-started on mavens website
>> but they don't speak to what I'm trying to do. Can anyone point me in
>> the right direction?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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


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


Re: Multi-module passing properties to children

Posted by Jared Blitzstein <ma...@blitzstein.net>.
Does using the parent tag require the project to be in a repository?  
I planned on having this "suitepom" accessible via CVS but not  
something that is going to be installed in our company repo. I may be  
way off base though.

Also, how would you pass something through like a version? The  
version tag is required in the child pom so you can't leave it out,  
and if I do ${version} it doesn't pick that up from the definition in  
the master pom, it just uses "${version}" literally.

On May 2, 2007, at 5:17 PM, Wayne Fay wrote:

> Put the shared properties in profiles in the parent pom, include the
> children as <modules/> in the parent pom, and use the parent tag in
> the children to share properties with all your poms.
>
> Or is there a specific reason this is not sufficient?
>
> Wayne
>
> On 5/2/07, Jared Blitzstein <ma...@blitzstein.net> wrote:
>> I have 5 projects that I want to build as a suite.  I created a  
>> multi-
>> module to do this and it's fine out of the box for just calling the
>> sub projects. But I need to be able to set variables in the multi-
>> module to pass in like the version, profile, and some other basic
>> things. But I also need to make sure each of these projects can live
>> on their own. I've read http://www.sonatype.com/book/pom-
>> relationships.html as well as the getting-started on mavens website
>> but they don't speak to what I'm trying to do. Can anyone point me in
>> the right direction?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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


Re: Multi-module passing properties to children

Posted by wayneaz <wa...@yahoo.com>.
Wayne, your answer sounds like it might solve my problem, but I am a new user
and am not sure of the syntax to implement your suggestion.

I am creating a buildnumber with a time stamp in the parent pom using the
buildnumber plugin.  I want to pass the resultant property, ${buildNumber},
to all the children to include in their manifests.  I have tried several
things, but have found no way to reference this property in the children
poms.

I have been through hundreds of postings and googled other items and this
question seems to come up a lot, but no one ever responds or their response
is too criptic for a novice to implement.

Your help would be appreciated.

Thanks
Wayne



Wayne Fay wrote:
> 
> Put the shared properties in profiles in the parent pom, include the
> children as <modules/> in the parent pom, and use the parent tag in
> the children to share properties with all your poms.
> 
> Or is there a specific reason this is not sufficient?
> 
> Wayne
> 
> On 5/2/07, Jared Blitzstein <ma...@blitzstein.net> wrote:
>> I have 5 projects that I want to build as a suite.  I created a multi-
>> module to do this and it's fine out of the box for just calling the
>> sub projects. But I need to be able to set variables in the multi-
>> module to pass in like the version, profile, and some other basic
>> things. But I also need to make sure each of these projects can live
>> on their own. I've read http://www.sonatype.com/book/pom-
>> relationships.html as well as the getting-started on mavens website
>> but they don't speak to what I'm trying to do. Can anyone point me in
>> the right direction?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Multi-module-passing-properties-to-children-tp10294239s177p16321438.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


Re: Multi-module passing properties to children

Posted by Wayne Fay <wa...@gmail.com>.
Put the shared properties in profiles in the parent pom, include the
children as <modules/> in the parent pom, and use the parent tag in
the children to share properties with all your poms.

Or is there a specific reason this is not sufficient?

Wayne

On 5/2/07, Jared Blitzstein <ma...@blitzstein.net> wrote:
> I have 5 projects that I want to build as a suite.  I created a multi-
> module to do this and it's fine out of the box for just calling the
> sub projects. But I need to be able to set variables in the multi-
> module to pass in like the version, profile, and some other basic
> things. But I also need to make sure each of these projects can live
> on their own. I've read http://www.sonatype.com/book/pom-
> relationships.html as well as the getting-started on mavens website
> but they don't speak to what I'm trying to do. Can anyone point me in
> the right direction?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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