You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Carsten Ziegeler <cz...@apache.org> on 2008/01/08 08:46:54 UTC

Release Configuration

I just found out that profile inheritance in maven is not implemented by 
design [1].
And this means that the "release" profile in our parent pom is useless 
as you can't apply it to a sub project. It seems that most other 
projects at Apache have a similar configuration, so I'm wondering if 
there is any trick to get it working?

Carsten


[1] http://www.nabble.com/Profile-inheritance-td8259757.html#a8260582
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Release Configuration

Posted by Carsten Ziegeler <cz...@apache.org>.
Niall Pemberton wrote:
> 
> Just tried that for the first time (in commons-skin) and it didn't
> list release as an active profile - so don't know what that means -
> help broken or profile not active?
> 
I think Stuarts mail explains this - the profile is not inherited but 
the settigns/plugins defined in the parent pom.

Thanks for your help
Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Release Configuration

Posted by Niall Pemberton <ni...@gmail.com>.
On Jan 8, 2008 3:21 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Niall Pemberton wrote:
> > On Jan 8, 2008 7:46 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> >> I just found out that profile inheritance in maven is not implemented by
> >> design [1].
> >> And this means that the "release" profile in our parent pom is useless
> >> as you can't apply it to a sub project. It seems that most other
> >> projects at Apache have a similar configuration, so I'm wondering if
> >> there is any trick to get it working?
> >
> > The only problem we've had in Apache Commons with using a "release"
> > profile in our parent pom is that when the release plugin calls other
> > plugins it doesn't pass on the "arguments" specifying the profile
> > which means that the called plugin doesn't use the profile. To resolve
> > that you can also specify the profile as an "arguments" parameter -
> > for example:
> >
> >    mvn -Prelease -Darguments="-Prelease" release:perform
> >
> > Alternatively you can configure the arguments for the release-plugin
> > in the profile (which is what we've done in commons):
> >
> >    http://svn.apache.org/viewvc?view=rev&revision=603888
> >
> Hmm, I'm not sure if I understand you correctly: you say that you can do
> a "mvn -Prelease release:perform" in let's say commons-io and then the
> configuration from the parent pom is used?

Yes but with the "arguments" paramater as well. Having said that the
only m2 release I've done so far was with commons-skin but it did work
and use the profile.

> So if you do a "mvn -Prelease help:active-profiles" in commons-io it
> will list "release" as an active profile although you don't have a
> profile definition for "release" in the pom of commons-io?

Just tried that for the first time (in commons-skin) and it didn't
list release as an active profile - so don't know what that means -
help broken or profile not active?

Niall

> Thanks
> Carsten

Re: Release Configuration

Posted by Carsten Ziegeler <cz...@apache.org>.
Stuart McCulloch wrote:
> 
> as I understand it, when you use "mvn -Prelease" it will activate the
> release profile
> in the parent pom (ie. it will enable the various elements there) and those
> elements
> will then be inherited by the sub-project - that's why profile inheritance
> isn't needed,
> because you get it for free... in fact inheriting profiles would lead to
> duplication
> 
> for example, if I run "mvn -Prelease help:effective-pom" for the
> bundleplugin, I see
> the additional elements relating to packaging and signing the project/bin
> artifacts.
Ah, yes - you're right - thanks for the explanation.
However, I had the case that "help:effective-pom" did not show the 
plugin configuration; hmm, I have to investigate this further.

> 
> however, it appears that Maven doesn't pass the -P setting onto forked
> processes,
> for example with "mvn release:perform", which is where Niall's suggestion of
> adding
> -Darguments="-Prelease" comes in.
> 
Ok, thanks!

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Release Configuration

Posted by Stuart McCulloch <st...@jayway.net>.
On 08/01/2008, Carsten Ziegeler <cz...@apache.org> wrote:
>
> Niall Pemberton wrote:
> > On Jan 8, 2008 7:46 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> >> I just found out that profile inheritance in maven is not implemented
> by
> >> design [1].
> >> And this means that the "release" profile in our parent pom is useless
> >> as you can't apply it to a sub project. It seems that most other
> >> projects at Apache have a similar configuration, so I'm wondering if
> >> there is any trick to get it working?
> >
> > The only problem we've had in Apache Commons with using a "release"
> > profile in our parent pom is that when the release plugin calls other
> > plugins it doesn't pass on the "arguments" specifying the profile
> > which means that the called plugin doesn't use the profile. To resolve
> > that you can also specify the profile as an "arguments" parameter -
> > for example:
> >
> >    mvn -Prelease -Darguments="-Prelease" release:perform
> >
> > Alternatively you can configure the arguments for the release-plugin
> > in the profile (which is what we've done in commons):
> >
> >    http://svn.apache.org/viewvc?view=rev&revision=603888
> >
> Hmm, I'm not sure if I understand you correctly: you say that you can do
> a "mvn -Prelease release:perform" in let's say commons-io and then the
> configuration from the parent pom is used?
>
> So if you do a "mvn -Prelease help:active-profiles" in commons-io it
> will list "release" as an active profile although you don't have a
> profile definition for "release" in the pom of commons-io?


as I understand it, when you use "mvn -Prelease" it will activate the
release profile
in the parent pom (ie. it will enable the various elements there) and those
elements
will then be inherited by the sub-project - that's why profile inheritance
isn't needed,
because you get it for free... in fact inheriting profiles would lead to
duplication

for example, if I run "mvn -Prelease help:effective-pom" for the
bundleplugin, I see
the additional elements relating to packaging and signing the project/bin
artifacts.

however, it appears that Maven doesn't pass the -P setting onto forked
processes,
for example with "mvn release:perform", which is where Niall's suggestion of
adding
-Darguments="-Prelease" comes in.

HTH

Thanks
> Carsten
> --
> Carsten Ziegeler
> cziegeler@apache.org
>

-- 
Cheers, Stuart

Re: Release Configuration

Posted by Carsten Ziegeler <cz...@apache.org>.
Niall Pemberton wrote:
> On Jan 8, 2008 7:46 AM, Carsten Ziegeler <cz...@apache.org> wrote:
>> I just found out that profile inheritance in maven is not implemented by
>> design [1].
>> And this means that the "release" profile in our parent pom is useless
>> as you can't apply it to a sub project. It seems that most other
>> projects at Apache have a similar configuration, so I'm wondering if
>> there is any trick to get it working?
> 
> The only problem we've had in Apache Commons with using a "release"
> profile in our parent pom is that when the release plugin calls other
> plugins it doesn't pass on the "arguments" specifying the profile
> which means that the called plugin doesn't use the profile. To resolve
> that you can also specify the profile as an "arguments" parameter -
> for example:
> 
>    mvn -Prelease -Darguments="-Prelease" release:perform
> 
> Alternatively you can configure the arguments for the release-plugin
> in the profile (which is what we've done in commons):
> 
>    http://svn.apache.org/viewvc?view=rev&revision=603888
> 
Hmm, I'm not sure if I understand you correctly: you say that you can do 
a "mvn -Prelease release:perform" in let's say commons-io and then the 
configuration from the parent pom is used?

So if you do a "mvn -Prelease help:active-profiles" in commons-io it 
will list "release" as an active profile although you don't have a 
profile definition for "release" in the pom of commons-io?

Thanks
Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Release Configuration

Posted by Niall Pemberton <ni...@gmail.com>.
On Jan 8, 2008 7:46 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> I just found out that profile inheritance in maven is not implemented by
> design [1].
> And this means that the "release" profile in our parent pom is useless
> as you can't apply it to a sub project. It seems that most other
> projects at Apache have a similar configuration, so I'm wondering if
> there is any trick to get it working?

The only problem we've had in Apache Commons with using a "release"
profile in our parent pom is that when the release plugin calls other
plugins it doesn't pass on the "arguments" specifying the profile
which means that the called plugin doesn't use the profile. To resolve
that you can also specify the profile as an "arguments" parameter -
for example:

   mvn -Prelease -Darguments="-Prelease" release:perform

Alternatively you can configure the arguments for the release-plugin
in the profile (which is what we've done in commons):

   http://svn.apache.org/viewvc?view=rev&revision=603888

Niall

> Carsten
>
>
> [1] http://www.nabble.com/Profile-inheritance-td8259757.html#a8260582
> --
> Carsten Ziegeler
> cziegeler@apache.org
>