You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Paul Gier <pg...@redhat.com> on 2008/04/25 17:08:11 UTC

Multiple -P options

Hi Everyone,

Currently maven only handles a single -P option to activate profiles.  I created 
a small patch for this issue (http://jira.codehaus.org/browse/MNG-3268) that 
allows -P to be specified multiple times on the command line.  Before I apply 
it, is this something that can go into maven 2.0.x?  Or should this go only into 
2.1?

Thanks!

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


Re: Multiple -P options

Posted by Paul Gier <pg...@redhat.com>.
Another use case as described in the issue is that if you script your call to 
maven with a -P parameter, and then you want to pass an additional profile in 
when calling the script, using multiple -P makes things simpler.

Jesse McConnell wrote:
> well, configuration on something like the release plugin can specify
> -Papache-release and then the user might have a profile being activated from
> the commandline of the release like -Pall-modules which results in whatever
> is munging these things together has to find the different instances and to
> do the right thing whereas if multiple -P options its simpler and less error
> prone..
> 
> off the top of my head at least
> 
> jesse
> 
> On Fri, Apr 25, 2008 at 11:26 AM, Jason van Zyl <ja...@maven.org> wrote:
> 
>> Why do you need multiple -P when you can specify -Pone,two,three ?
>>
>>
>> On 25-Apr-08, at 8:08 AM, Paul Gier wrote:
>>
>>> Hi Everyone,
>>>
>>> Currently maven only handles a single -P option to activate profiles.  I
>>> created a small patch for this issue (
>>> http://jira.codehaus.org/browse/MNG-3268) that allows -P to be specified
>>> multiple times on the command line.  Before I apply it, is this something
>>> that can go into maven 2.0.x?  Or should this go only into 2.1?
>>>
>>> Thanks!
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder,  Apache Maven
>> jason at sonatype dot com
>> ----------------------------------------------------------
>>
>> happiness is like a butterfly: the more you chase it, the more it will
>> elude you, but if you turn your attention to other things, it will come
>> and sit softly on your shoulder ...
>>
>> -- Thoreau
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
> 
> 


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


Re: Multiple -P options

Posted by Jesse McConnell <je...@gmail.com>.
well, configuration on something like the release plugin can specify
-Papache-release and then the user might have a profile being activated from
the commandline of the release like -Pall-modules which results in whatever
is munging these things together has to find the different instances and to
do the right thing whereas if multiple -P options its simpler and less error
prone..

off the top of my head at least

jesse

On Fri, Apr 25, 2008 at 11:26 AM, Jason van Zyl <ja...@maven.org> wrote:

> Why do you need multiple -P when you can specify -Pone,two,three ?
>
>
> On 25-Apr-08, at 8:08 AM, Paul Gier wrote:
>
>> Hi Everyone,
>>
>> Currently maven only handles a single -P option to activate profiles.  I
>> created a small patch for this issue (
>> http://jira.codehaus.org/browse/MNG-3268) that allows -P to be specified
>> multiple times on the command line.  Before I apply it, is this something
>> that can go into maven 2.0.x?  Or should this go only into 2.1?
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> jason at sonatype dot com
> ----------------------------------------------------------
>
> happiness is like a butterfly: the more you chase it, the more it will
> elude you, but if you turn your attention to other things, it will come
> and sit softly on your shoulder ...
>
> -- Thoreau
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
jesse mcconnell
jesse.mcconnell@gmail.com

Re: Multiple -P options

Posted by Jason van Zyl <ja...@maven.org>.
Why do you need multiple -P when you can specify -Pone,two,three ?

On 25-Apr-08, at 8:08 AM, Paul Gier wrote:
> Hi Everyone,
>
> Currently maven only handles a single -P option to activate  
> profiles.  I created a small patch for this issue (http://jira.codehaus.org/browse/MNG-3268 
> ) that allows -P to be specified multiple times on the command  
> line.  Before I apply it, is this something that can go into maven  
> 2.0.x?  Or should this go only into 2.1?
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

-- Thoreau 




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


Re: Multiple -P options

Posted by Paul Gier <pg...@redhat.com>.
Yeah, you're probably talking about the same issue that I ran into 
(MRELEASE-288) that caused me to look into this.

Jesse McConnell wrote:
> just a note that this would make an annoying part of the release plugin
> easier as well, it tries to gather up  and reformat mulitple -P options that
> might aggregate into a cli execution and misses a case or two I think.
> 
> jesse
> 
> On Fri, Apr 25, 2008 at 10:08 AM, Paul Gier <pg...@redhat.com> wrote:
> 
>> Hi Everyone,
>>
>> Currently maven only handles a single -P option to activate profiles.  I
>> created a small patch for this issue (
>> http://jira.codehaus.org/browse/MNG-3268) that allows -P to be specified
>> multiple times on the command line.  Before I apply it, is this something
>> that can go into maven 2.0.x?  Or should this go only into 2.1?
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
> 
> 


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


Re: Multiple -P options

Posted by Jesse McConnell <je...@gmail.com>.
just a note that this would make an annoying part of the release plugin
easier as well, it tries to gather up  and reformat mulitple -P options that
might aggregate into a cli execution and misses a case or two I think.

jesse

On Fri, Apr 25, 2008 at 10:08 AM, Paul Gier <pg...@redhat.com> wrote:

> Hi Everyone,
>
> Currently maven only handles a single -P option to activate profiles.  I
> created a small patch for this issue (
> http://jira.codehaus.org/browse/MNG-3268) that allows -P to be specified
> multiple times on the command line.  Before I apply it, is this something
> that can go into maven 2.0.x?  Or should this go only into 2.1?
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
jesse mcconnell
jesse.mcconnell@gmail.com

Re: Multiple -P options

Posted by Stephen Connolly <st...@gmail.com>.
And -P!profile or -P-profile to remove it...

This is especially handy if you have one profile that is always active by
default... the hack of -Pdoesnotexist to disable it is not nice

On Mon, Apr 28, 2008 at 11:03 AM, Bernhard David <da...@elca.ch>
wrote:

> Hello,
>
> well there's "mvn help:active-profiles" for the active ones already - A
> debugging option would be good too.
>
> On the topic of profiles: I'd find it useful to have "-Pprofile" work as
> usual, but "-P+profile" to add "profile" to the active profiles
> *without* preventing the default ones from being activated.
>
> Greetings,
>
> David
>
> > -----Original Message-----
> > From: david@davidkarlsen.com [mailto:david@davidkarlsen.com]
> > Sent: 28 April 2008 11:18
> > To: Maven Developers List
> > Subject: Re: Multiple -P options
> >
> > On Mon, 28 Apr 2008, Paul Benedict wrote:
> >
> > > Maybe a new option to help debugging would help. One that
> > would printout all
> > > activated profiles, plus any profile names that were not found.
> >
> > The help plugin can be used for this:
> > http://maven.apache.org/plugins/maven-help-plugin/active-profi
> les-mojo.html<http://maven.apache.org/plugins/maven-help-plugin/active-profiles-mojo.html>
> >
> > --
> > David J. M. Karlsen - +47 90 68 22 43
> > http://www.davidkarlsen.com
> > http://mp3.davidkarlsen.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

RE: Multiple -P options

Posted by Bernhard David <da...@elca.ch>.
Hello,

well there's "mvn help:active-profiles" for the active ones already - A
debugging option would be good too.

On the topic of profiles: I'd find it useful to have "-Pprofile" work as
usual, but "-P+profile" to add "profile" to the active profiles
*without* preventing the default ones from being activated.

Greetings,

David 

> -----Original Message-----
> From: david@davidkarlsen.com [mailto:david@davidkarlsen.com] 
> Sent: 28 April 2008 11:18
> To: Maven Developers List
> Subject: Re: Multiple -P options
> 
> On Mon, 28 Apr 2008, Paul Benedict wrote:
> 
> > Maybe a new option to help debugging would help. One that 
> would printout all
> > activated profiles, plus any profile names that were not found.
> 
> The help plugin can be used for this:
> http://maven.apache.org/plugins/maven-help-plugin/active-profi
les-mojo.html
> 
> --
> David J. M. Karlsen - +47 90 68 22 43
> http://www.davidkarlsen.com
> http://mp3.davidkarlsen.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 

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


Re: Multiple -P options

Posted by da...@davidkarlsen.com.
On Mon, 28 Apr 2008, Paul Benedict wrote:

> Maybe a new option to help debugging would help. One that would printout all
> activated profiles, plus any profile names that were not found.

The help plugin can be used for this:
http://maven.apache.org/plugins/maven-help-plugin/active-profiles-mojo.html

--
David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com

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


Re: Multiple -P options

Posted by Paul Benedict <pb...@apache.org>.
Maybe a new option to help debugging would help. One that would printout all
activated profiles, plus any profile names that were not found.

Paul

On Sun, Apr 27, 2008 at 8:08 PM, Barrie Treloar <ba...@gmail.com> wrote:

> On Mon, Apr 28, 2008 at 9:57 AM, Brian E. Fox <br...@reply.infinity.nu>
> wrote:
> > The fact that a profile is activated from the command line or
> >  settings.xml applies to the entire execution, which means if that
> >  profile is exists in multiple modules, it will be activated in each of
> >  them. The original issue for this was:
> >  http://jira.codehaus.org/browse/MNG-1420
>
> Fair enough.
>
> How do we avoid the problems that occur with typos in profile activation?
>
> I've wasted a bit of time tracking down a typo when my build wasn't
> behaving as expected because a profile was not activated.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Multiple -P options

Posted by Barrie Treloar <ba...@gmail.com>.
On Mon, Apr 28, 2008 at 9:57 AM, Brian E. Fox <br...@reply.infinity.nu> wrote:
> The fact that a profile is activated from the command line or
>  settings.xml applies to the entire execution, which means if that
>  profile is exists in multiple modules, it will be activated in each of
>  them. The original issue for this was:
>  http://jira.codehaus.org/browse/MNG-1420

Fair enough.

How do we avoid the problems that occur with typos in profile activation?

I've wasted a bit of time tracking down a typo when my build wasn't
behaving as expected because a profile was not activated.

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


RE: Multiple -P options

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
The fact that a profile is activated from the command line or
settings.xml applies to the entire execution, which means if that
profile is exists in multiple modules, it will be activated in each of
them. The original issue for this was:
http://jira.codehaus.org/browse/MNG-1420



-----Original Message-----
From: Barrie Treloar [mailto:baerrach@gmail.com] 
Sent: Sunday, April 27, 2008 8:13 PM
To: Maven Developers List
Subject: Re: Multiple -P options

On Mon, Apr 28, 2008 at 9:17 AM, Brian E. Fox <br...@reply.infinity.nu>
wrote:
> I tried fixing that before and it caused a ton of issues. Not every
>  project will contain the profile to be activated so it warns/errors
on
>  all of them that don't...this is even more of a mess.

Profiles are only meant to be activated at the same directory that mvn
is run.
They don't get passed on down to modules. (I've had problems with this
misunderstanding before)

So why should there be lots of warnings?

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


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


Re: Multiple -P options

Posted by Barrie Treloar <ba...@gmail.com>.
On Mon, Apr 28, 2008 at 9:17 AM, Brian E. Fox <br...@reply.infinity.nu> wrote:
> I tried fixing that before and it caused a ton of issues. Not every
>  project will contain the profile to be activated so it warns/errors on
>  all of them that don't...this is even more of a mess.

Profiles are only meant to be activated at the same directory that mvn is run.
They don't get passed on down to modules. (I've had problems with this
misunderstanding before)

So why should there be lots of warnings?

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


RE: Multiple -P options

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
I tried fixing that before and it caused a ton of issues. Not every
project will contain the profile to be activated so it warns/errors on
all of them that don't...this is even more of a mess. 

-----Original Message-----
From: Barrie Treloar [mailto:baerrach@gmail.com] 
Sent: Sunday, April 27, 2008 7:41 PM
To: Maven Developers List
Subject: Re: Multiple -P options

On Sat, Apr 26, 2008 at 2:05 AM, Brian E. Fox <br...@reply.infinity.nu>
wrote:
> While you're in there, any change you can see why the -P-profile
syntax
>  isn't working? MNG-3545 and MNG-3527

Since we are asking "while you're there" questions.

What happens when you specify a profile that can not be activated?

With mvn 2.0.7 it silently ignores the missing profile, when I think
the build should fail with an error message indicating the profile
could not be activated.

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


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


Re: Multiple -P options

Posted by Barrie Treloar <ba...@gmail.com>.
On Sat, Apr 26, 2008 at 2:05 AM, Brian E. Fox <br...@reply.infinity.nu> wrote:
> While you're in there, any change you can see why the -P-profile syntax
>  isn't working? MNG-3545 and MNG-3527

Since we are asking "while you're there" questions.

What happens when you specify a profile that can not be activated?

With mvn 2.0.7 it silently ignores the missing profile, when I think
the build should fail with an error message indicating the profile
could not be activated.

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


Re: Multiple -P options

Posted by Paul Gier <pg...@redhat.com>.
Sure, I think I can fix those too.

Brian E. Fox wrote:
> While you're in there, any change you can see why the -P-profile syntax
> isn't working? MNG-3545 and MNG-3527
> 
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com] 
> Sent: Friday, April 25, 2008 11:43 AM
> To: Maven Developers List
> Subject: Re: Multiple -P options
> 
> Ok, I'll add an integration test for it.
> 
> Brian E. Fox wrote:
>> This can go into 2.0.10 but we need an IT to test the behavior.
>>
>> -----Original Message-----
>> From: Paul Gier [mailto:pgier@redhat.com] 
>> Sent: Friday, April 25, 2008 11:08 AM
>> To: Maven Developers List
>> Subject: Multiple -P options
>>
>> Hi Everyone,
>>
>> Currently maven only handles a single -P option to activate profiles.
> I
>> created 
>> a small patch for this issue
> (http://jira.codehaus.org/browse/MNG-3268)
>> that 
>> allows -P to be specified multiple times on the command line.  Before
> I
>> apply 
>> it, is this something that can go into maven 2.0.x?  Or should this go
>> only into 
>> 2.1?
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


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


RE: Multiple -P options

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
While you're in there, any change you can see why the -P-profile syntax
isn't working? MNG-3545 and MNG-3527

-----Original Message-----
From: Paul Gier [mailto:pgier@redhat.com] 
Sent: Friday, April 25, 2008 11:43 AM
To: Maven Developers List
Subject: Re: Multiple -P options

Ok, I'll add an integration test for it.

Brian E. Fox wrote:
> This can go into 2.0.10 but we need an IT to test the behavior.
> 
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com] 
> Sent: Friday, April 25, 2008 11:08 AM
> To: Maven Developers List
> Subject: Multiple -P options
> 
> Hi Everyone,
> 
> Currently maven only handles a single -P option to activate profiles.
I
> created 
> a small patch for this issue
(http://jira.codehaus.org/browse/MNG-3268)
> that 
> allows -P to be specified multiple times on the command line.  Before
I
> apply 
> it, is this something that can go into maven 2.0.x?  Or should this go
> only into 
> 2.1?
> 
> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


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


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


Re: Multiple -P options

Posted by Paul Gier <pg...@redhat.com>.
Ok, I'll add an integration test for it.

Brian E. Fox wrote:
> This can go into 2.0.10 but we need an IT to test the behavior.
> 
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com] 
> Sent: Friday, April 25, 2008 11:08 AM
> To: Maven Developers List
> Subject: Multiple -P options
> 
> Hi Everyone,
> 
> Currently maven only handles a single -P option to activate profiles.  I
> created 
> a small patch for this issue (http://jira.codehaus.org/browse/MNG-3268)
> that 
> allows -P to be specified multiple times on the command line.  Before I
> apply 
> it, is this something that can go into maven 2.0.x?  Or should this go
> only into 
> 2.1?
> 
> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


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


RE: Multiple -P options

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
This can go into 2.0.10 but we need an IT to test the behavior.

-----Original Message-----
From: Paul Gier [mailto:pgier@redhat.com] 
Sent: Friday, April 25, 2008 11:08 AM
To: Maven Developers List
Subject: Multiple -P options

Hi Everyone,

Currently maven only handles a single -P option to activate profiles.  I
created 
a small patch for this issue (http://jira.codehaus.org/browse/MNG-3268)
that 
allows -P to be specified multiple times on the command line.  Before I
apply 
it, is this something that can go into maven 2.0.x?  Or should this go
only into 
2.1?

Thanks!

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


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