You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2015/03/11 17:10:08 UTC

MavenProject properties within a multi module build

Hi,

currently i have the problem creating a plugin which adds some 
properties...to the current project...

	@Parameter(defaultValue = "${project}", readonly = true, required = true)
	private MavenProject mavenProject;


         mavenProject.getProperties().put("NAme", "Value");


This results in having the new property only in the current project 
(root of my multi module build) but thos properties aren't being 
available in other project deeper in the module levels...This
seemed to be the result of optimizing it to execute only in 
executionRoot()...

So after further investigation i have found that for example the 
buildnumber-maven-plugin explicit goes through the list of reactor 
projects and adds the property explicit to each of the reactor modules...


Is this intended behaviour or am i doing something wrong or is there a 
more elegant way to solve this?

Kind regards
Karl Heinz Marbaise

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


Re: MavenProject properties within a multi module build

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Stephen,

Yes the MavenSession has a list of reactor projects...that was not the 
point...

I thought having a more convenient way to set properties for all modules 
in a build (multi module build)...

I used the list of reactor projects to go through the list like 
buildnumber-maven-plugin does...which solved my problem...but i thought 
there could be a more simpler way...

Thanks.
Karl Heinz Marbiase

On 3/12/15 11:57 AM, Stephen Connolly wrote:
> MavenSession has(/had?) the reactor projects
>
> On 12 March 2015 at 09:19, Karl Heinz Marbaise <khmarbaise@gmx.de
> <ma...@gmx.de>> wrote:
>
>     Hi Kristian,
>
>     first thanks for your answer...
>
>     based on what i've seen there seemed to be no such reactor-wdie map
>     available ? May be Jason knows more ?
>
>     Thanks
>     Kind regards
>     Karl Heinz Marbaise
>     On 3/12/15 10:16 AM, Kristian Rosenvold wrote:
>
>         The behaviour is "intended". I am not sure if there is any
>         reactor-wide
>         map that is available anywhere.
>
>         Kristian
>
>
>         2015-03-11 17:10 GMT+01:00 Karl Heinz Marbaise
>         <khmarbaise@gmx.de <ma...@gmx.de>
>         <mailto:khmarbaise@gmx.de <ma...@gmx.de>>>:
>
>              Hi,
>
>              currently i have the problem creating a plugin which adds some
>              properties...to the current project...
>
>                       @Parameter(defaultValue = "${project}", readonly =
>         true,
>              required = true)
>                       private MavenProject mavenProject;
>
>
>                       mavenProject.getProperties().____put("NAme", "Value");
>
>
>              This results in having the new property only in the current
>         project
>              (root of my multi module build) but thos properties aren't
>         being
>              available in other project deeper in the module levels...This
>              seemed to be the result of optimizing it to execute only in
>              executionRoot()...
>
>              So after further investigation i have found that for
>         example the
>              buildnumber-maven-plugin explicit goes through the list of
>         reactor
>              projects and adds the property explicit to each of the reactor
>              modules...
>
>
>              Is this intended behaviour or am i doing something wrong or
>         is there
>              a more elegant way to solve this?
>
>              Kind regards
>              Karl Heinz Marbaise
>

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


Re: MavenProject properties within a multi module build

Posted by Stephen Connolly <st...@gmail.com>.
MavenSession has(/had?) the reactor projects

On 12 March 2015 at 09:19, Karl Heinz Marbaise <kh...@gmx.de> wrote:

> Hi Kristian,
>
> first thanks for your answer...
>
> based on what i've seen there seemed to be no such reactor-wdie map
> available ? May be Jason knows more ?
>
> Thanks
> Kind regards
> Karl Heinz Marbaise
> On 3/12/15 10:16 AM, Kristian Rosenvold wrote:
>
>> The behaviour is "intended". I am not sure if there is any reactor-wide
>> map that is available anywhere.
>>
>> Kristian
>>
>>
>> 2015-03-11 17:10 GMT+01:00 Karl Heinz Marbaise <khmarbaise@gmx.de
>> <ma...@gmx.de>>:
>>
>>     Hi,
>>
>>     currently i have the problem creating a plugin which adds some
>>     properties...to the current project...
>>
>>              @Parameter(defaultValue = "${project}", readonly = true,
>>     required = true)
>>              private MavenProject mavenProject;
>>
>>
>>              mavenProject.getProperties().__put("NAme", "Value");
>>
>>
>>     This results in having the new property only in the current project
>>     (root of my multi module build) but thos properties aren't being
>>     available in other project deeper in the module levels...This
>>     seemed to be the result of optimizing it to execute only in
>>     executionRoot()...
>>
>>     So after further investigation i have found that for example the
>>     buildnumber-maven-plugin explicit goes through the list of reactor
>>     projects and adds the property explicit to each of the reactor
>>     modules...
>>
>>
>>     Is this intended behaviour or am i doing something wrong or is there
>>     a more elegant way to solve this?
>>
>>     Kind regards
>>     Karl Heinz Marbaise
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: MavenProject properties within a multi module build

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Kristian,

first thanks for your answer...

based on what i've seen there seemed to be no such reactor-wdie map 
available ? May be Jason knows more ?

Thanks
Kind regards
Karl Heinz Marbaise
On 3/12/15 10:16 AM, Kristian Rosenvold wrote:
> The behaviour is "intended". I am not sure if there is any reactor-wide
> map that is available anywhere.
>
> Kristian
>
>
> 2015-03-11 17:10 GMT+01:00 Karl Heinz Marbaise <khmarbaise@gmx.de
> <ma...@gmx.de>>:
>
>     Hi,
>
>     currently i have the problem creating a plugin which adds some
>     properties...to the current project...
>
>              @Parameter(defaultValue = "${project}", readonly = true,
>     required = true)
>              private MavenProject mavenProject;
>
>
>              mavenProject.getProperties().__put("NAme", "Value");
>
>
>     This results in having the new property only in the current project
>     (root of my multi module build) but thos properties aren't being
>     available in other project deeper in the module levels...This
>     seemed to be the result of optimizing it to execute only in
>     executionRoot()...
>
>     So after further investigation i have found that for example the
>     buildnumber-maven-plugin explicit goes through the list of reactor
>     projects and adds the property explicit to each of the reactor
>     modules...
>
>
>     Is this intended behaviour or am i doing something wrong or is there
>     a more elegant way to solve this?
>
>     Kind regards
>     Karl Heinz Marbaise
>

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


Re: MavenProject properties within a multi module build

Posted by Kristian Rosenvold <kr...@gmail.com>.
The behaviour is "intended". I am not sure if there is any reactor-wide map
that is available anywhere.

Kristian


2015-03-11 17:10 GMT+01:00 Karl Heinz Marbaise <kh...@gmx.de>:

> Hi,
>
> currently i have the problem creating a plugin which adds some
> properties...to the current project...
>
>         @Parameter(defaultValue = "${project}", readonly = true, required
> = true)
>         private MavenProject mavenProject;
>
>
>         mavenProject.getProperties().put("NAme", "Value");
>
>
> This results in having the new property only in the current project (root
> of my multi module build) but thos properties aren't being available in
> other project deeper in the module levels...This
> seemed to be the result of optimizing it to execute only in
> executionRoot()...
>
> So after further investigation i have found that for example the
> buildnumber-maven-plugin explicit goes through the list of reactor projects
> and adds the property explicit to each of the reactor modules...
>
>
> Is this intended behaviour or am i doing something wrong or is there a
> more elegant way to solve this?
>
> Kind regards
> Karl Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>