You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Jackman <dj...@fast.no> on 2007/01/26 22:21:54 UTC

Activating a profile with settings.xml

According to the documentation at http://maven.apache.org/settings.html:
    "Any profile id defined as an activeProfile will be active,
reguardless of any environment settings. If no matching profile is found
nothing will happen. For example, if env-test is an activeProfile, a
profile in a pom.xml (or profile.xml with a corrosponding id will be
active. If no such profile is found then execution will continue as
normal."
 
However, I cannot get Maven to behave this way.  Should profiles defined
in the pom be able to be activated in this way, or are the docs
incorrect?
 
..David..
 


FASTforward '07
The Industry's Largest Business &
Technology Conference Focused on Search
February 7th - 9th, San Diego, CA
www.fastforward07.com

RE: Activating a profile with settings.xml

Posted by David Jackman <dj...@fast.no>.
I'm using 2.0.4. 

-----Original Message-----
From: John Casey [mailto:casey.john.d@gmail.com] 
Sent: Tuesday, January 30, 2007 9:46 AM
To: Maven Users List
Subject: Re: Activating a profile with settings.xml

It seems to me that we "fixed" that some time ago because of a logged issue, such that only external profiles listed in the activeProfiles section will be affected. Profiles in the POM are not included in that group.

-j

On 1/30/07, Eric Redmond <er...@gmail.com> wrote:
>
> What version of Maven are you using?
>
> On 1/30/07, David Jackman <dj...@fast.no> wrote:
> >
> > In my case, there was no parent pom.
> >
> > My pom.xml contains:
> >   <profiles>
> >     <profile>
> >       <id>myProfile</id>
> >       ...
> >     </profile>
> >   </profiles>
> >
> > My settings.xml contains:
> >   <activeProfiles>
> >     <activeProfile>myProfile</activeProfile>
> >   </activeProfiles>
> >
> > The mvn help:active-profiles command shows: "There are no active 
> > profiles."
> >
> > Is this the correct behavior?
> >
> >
> > -----Original Message-----
> > From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com]
> > Sent: Sunday, January 28, 2007 2:31 AM
> > To: Maven Users List
> > Subject: Re: Activating a profile with settings.xml
> >
> > The current version is buggy. It does not display profiles that are 
> > defined in the parent pom.
> >
> > Stéphane
> >
> > On 1/27/07, Eric Redmond <er...@gmail.com> wrote:
> > > Profiles should be activated in this way.
> > >
> > > Try: "mvn help:active-profiles"
> > > See if your profile is active.
> > >
> > > Eric
> > >
> > > On 1/26/07, David Jackman <dj...@fast.no> wrote:
> > > >
> > > > According to the documentation at
> > http://maven.apache.org/settings.html:
> > > >     "Any profile id defined as an activeProfile will be active, 
> > > > reguardless of any environment settings. If no matching profile 
> > > > is found nothing will happen. For example, if env-test is an 
> > > > activeProfile, a profile in a pom.xml (or profile.xml with a 
> > > > corrosponding id will be active. If no such profile is found 
> > > > then execution will continue as normal."
> > > >
> > > > However, I cannot get Maven to behave this way.  Should profiles 
> > > > defined in the pom be able to be activated in this way, or are 
> > > > the docs incorrect?
> > > >
> > > > ..David..
> > > >
> > > >
> > > >
> > > > FASTforward '07
> > > > The Industry's Largest Business & Technology Conference Focused 
> > > > on Search February 7th - 9th, San Diego, CA 
> > > > www.fastforward07.com
> > > >
> > > >
> > >
> > >
> > > --
> > > Eric Redmond
> > > http://codehaus.org/~eredmond
> > >
> > >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> > FASTforward '07
> > The Industry's Largest Business &
> > Technology Conference Focused on Search February 7th - 9th, San 
> > Diego, CA www.fastforward07.com
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eric Redmond
> http://codehaus.org/~eredmond
>
>


FASTforward '07
The Industry's Largest Business &
Technology Conference Focused on Search
February 7th - 9th, San Diego, CA
www.fastforward07.com

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


RE: Activating a profile with settings.xml

Posted by David Jackman <dj...@fast.no>.
So, the behavior I'm seeing now is actually correct?  If so, the information on http://maven.apache.org/settings.html will need to change accordingly.

My problem is then how to activate a profile in the POM (it's in the POM because it lists repositories for distribution management, which can't be listed in settings.xml profiles).  I can activate the profile on the command line by setting a property (-D) or using the -P options, but this doesn't work when the SCM plugin does a release:perform or a deploy goal with scm:bootstrap (the plugin invokes Maven without the command line parameters).


-----Original Message-----
From: John Casey [mailto:casey.john.d@gmail.com] 
Sent: Tuesday, January 30, 2007 9:46 AM
To: Maven Users List
Subject: Re: Activating a profile with settings.xml

It seems to me that we "fixed" that some time ago because of a logged issue, such that only external profiles listed in the activeProfiles section will be affected. Profiles in the POM are not included in that group.

-j

On 1/30/07, Eric Redmond <er...@gmail.com> wrote:
>
> What version of Maven are you using?
>
> On 1/30/07, David Jackman <dj...@fast.no> wrote:
> >
> > In my case, there was no parent pom.
> >
> > My pom.xml contains:
> >   <profiles>
> >     <profile>
> >       <id>myProfile</id>
> >       ...
> >     </profile>
> >   </profiles>
> >
> > My settings.xml contains:
> >   <activeProfiles>
> >     <activeProfile>myProfile</activeProfile>
> >   </activeProfiles>
> >
> > The mvn help:active-profiles command shows: "There are no active 
> > profiles."
> >
> > Is this the correct behavior?
> >
> >
> > -----Original Message-----
> > From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com]
> > Sent: Sunday, January 28, 2007 2:31 AM
> > To: Maven Users List
> > Subject: Re: Activating a profile with settings.xml
> >
> > The current version is buggy. It does not display profiles that are 
> > defined in the parent pom.
> >
> > Stéphane
> >
> > On 1/27/07, Eric Redmond <er...@gmail.com> wrote:
> > > Profiles should be activated in this way.
> > >
> > > Try: "mvn help:active-profiles"
> > > See if your profile is active.
> > >
> > > Eric
> > >
> > > On 1/26/07, David Jackman <dj...@fast.no> wrote:
> > > >
> > > > According to the documentation at
> > http://maven.apache.org/settings.html:
> > > >     "Any profile id defined as an activeProfile will be active, 
> > > > reguardless of any environment settings. If no matching profile 
> > > > is found nothing will happen. For example, if env-test is an 
> > > > activeProfile, a profile in a pom.xml (or profile.xml with a 
> > > > corrosponding id will be active. If no such profile is found 
> > > > then execution will continue as normal."
> > > >
> > > > However, I cannot get Maven to behave this way.  Should profiles 
> > > > defined in the pom be able to be activated in this way, or are 
> > > > the docs incorrect?
> > > >
> > > > ..David..
> > > >
> > > >
> > > >
> > > > FASTforward '07
> > > > The Industry's Largest Business & Technology Conference Focused 
> > > > on Search February 7th - 9th, San Diego, CA 
> > > > www.fastforward07.com
> > > >
> > > >
> > >
> > >
> > > --
> > > Eric Redmond
> > > http://codehaus.org/~eredmond
> > >
> > >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> > FASTforward '07
> > The Industry's Largest Business &
> > Technology Conference Focused on Search February 7th - 9th, San 
> > Diego, CA www.fastforward07.com
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eric Redmond
> http://codehaus.org/~eredmond
>
>


FASTforward '07
The Industry's Largest Business &
Technology Conference Focused on Search
February 7th - 9th, San Diego, CA
www.fastforward07.com

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


Re: Activating a profile with settings.xml

Posted by John Casey <ca...@gmail.com>.
It seems to me that we "fixed" that some time ago because of a logged issue,
such that only external profiles listed in the activeProfiles section will
be affected. Profiles in the POM are not included in that group.

-j

On 1/30/07, Eric Redmond <er...@gmail.com> wrote:
>
> What version of Maven are you using?
>
> On 1/30/07, David Jackman <dj...@fast.no> wrote:
> >
> > In my case, there was no parent pom.
> >
> > My pom.xml contains:
> >   <profiles>
> >     <profile>
> >       <id>myProfile</id>
> >       ...
> >     </profile>
> >   </profiles>
> >
> > My settings.xml contains:
> >   <activeProfiles>
> >     <activeProfile>myProfile</activeProfile>
> >   </activeProfiles>
> >
> > The mvn help:active-profiles command shows: "There are no active
> > profiles."
> >
> > Is this the correct behavior?
> >
> >
> > -----Original Message-----
> > From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com]
> > Sent: Sunday, January 28, 2007 2:31 AM
> > To: Maven Users List
> > Subject: Re: Activating a profile with settings.xml
> >
> > The current version is buggy. It does not display profiles that are
> > defined in the parent pom.
> >
> > Stéphane
> >
> > On 1/27/07, Eric Redmond <er...@gmail.com> wrote:
> > > Profiles should be activated in this way.
> > >
> > > Try: "mvn help:active-profiles"
> > > See if your profile is active.
> > >
> > > Eric
> > >
> > > On 1/26/07, David Jackman <dj...@fast.no> wrote:
> > > >
> > > > According to the documentation at
> > http://maven.apache.org/settings.html:
> > > >     "Any profile id defined as an activeProfile will be active,
> > > > reguardless of any environment settings. If no matching profile is
> > > > found nothing will happen. For example, if env-test is an
> > > > activeProfile, a profile in a pom.xml (or profile.xml with a
> > > > corrosponding id will be active. If no such profile is found then
> > > > execution will continue as normal."
> > > >
> > > > However, I cannot get Maven to behave this way.  Should profiles
> > > > defined in the pom be able to be activated in this way, or are the
> > > > docs incorrect?
> > > >
> > > > ..David..
> > > >
> > > >
> > > >
> > > > FASTforward '07
> > > > The Industry's Largest Business &
> > > > Technology Conference Focused on Search February 7th - 9th, San
> > > > Diego, CA www.fastforward07.com
> > > >
> > > >
> > >
> > >
> > > --
> > > Eric Redmond
> > > http://codehaus.org/~eredmond
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> > FASTforward '07
> > The Industry's Largest Business &
> > Technology Conference Focused on Search
> > February 7th - 9th, San Diego, CA
> > www.fastforward07.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eric Redmond
> http://codehaus.org/~eredmond
>
>

Re: Activating a profile with settings.xml

Posted by Eric Redmond <er...@gmail.com>.
What version of Maven are you using?

On 1/30/07, David Jackman <dj...@fast.no> wrote:
>
> In my case, there was no parent pom.
>
> My pom.xml contains:
>   <profiles>
>     <profile>
>       <id>myProfile</id>
>       ...
>     </profile>
>   </profiles>
>
> My settings.xml contains:
>   <activeProfiles>
>     <activeProfile>myProfile</activeProfile>
>   </activeProfiles>
>
> The mvn help:active-profiles command shows: "There are no active
> profiles."
>
> Is this the correct behavior?
>
>
> -----Original Message-----
> From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com]
> Sent: Sunday, January 28, 2007 2:31 AM
> To: Maven Users List
> Subject: Re: Activating a profile with settings.xml
>
> The current version is buggy. It does not display profiles that are
> defined in the parent pom.
>
> Stéphane
>
> On 1/27/07, Eric Redmond <er...@gmail.com> wrote:
> > Profiles should be activated in this way.
> >
> > Try: "mvn help:active-profiles"
> > See if your profile is active.
> >
> > Eric
> >
> > On 1/26/07, David Jackman <dj...@fast.no> wrote:
> > >
> > > According to the documentation at
> http://maven.apache.org/settings.html:
> > >     "Any profile id defined as an activeProfile will be active,
> > > reguardless of any environment settings. If no matching profile is
> > > found nothing will happen. For example, if env-test is an
> > > activeProfile, a profile in a pom.xml (or profile.xml with a
> > > corrosponding id will be active. If no such profile is found then
> > > execution will continue as normal."
> > >
> > > However, I cannot get Maven to behave this way.  Should profiles
> > > defined in the pom be able to be activated in this way, or are the
> > > docs incorrect?
> > >
> > > ..David..
> > >
> > >
> > >
> > > FASTforward '07
> > > The Industry's Largest Business &
> > > Technology Conference Focused on Search February 7th - 9th, San
> > > Diego, CA www.fastforward07.com
> > >
> > >
> >
> >
> > --
> > Eric Redmond
> > http://codehaus.org/~eredmond
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
> FASTforward '07
> The Industry's Largest Business &
> Technology Conference Focused on Search
> February 7th - 9th, San Diego, CA
> www.fastforward07.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://codehaus.org/~eredmond

RE: Activating a profile with settings.xml

Posted by David Jackman <dj...@fast.no>.
In my case, there was no parent pom.  

My pom.xml contains:
  <profiles>
    <profile>
      <id>myProfile</id>
      ...
    </profile>
  </profiles>

My settings.xml contains:
  <activeProfiles>
    <activeProfile>myProfile</activeProfile>
  </activeProfiles>

The mvn help:active-profiles command shows: "There are no active profiles."

Is this the correct behavior?


-----Original Message-----
From: Stephane Nicoll [mailto:stephane.nicoll@gmail.com] 
Sent: Sunday, January 28, 2007 2:31 AM
To: Maven Users List
Subject: Re: Activating a profile with settings.xml

The current version is buggy. It does not display profiles that are defined in the parent pom.

Stéphane

On 1/27/07, Eric Redmond <er...@gmail.com> wrote:
> Profiles should be activated in this way.
>
> Try: "mvn help:active-profiles"
> See if your profile is active.
>
> Eric
>
> On 1/26/07, David Jackman <dj...@fast.no> wrote:
> >
> > According to the documentation at http://maven.apache.org/settings.html:
> >     "Any profile id defined as an activeProfile will be active, 
> > reguardless of any environment settings. If no matching profile is 
> > found nothing will happen. For example, if env-test is an 
> > activeProfile, a profile in a pom.xml (or profile.xml with a 
> > corrosponding id will be active. If no such profile is found then 
> > execution will continue as normal."
> >
> > However, I cannot get Maven to behave this way.  Should profiles 
> > defined in the pom be able to be activated in this way, or are the 
> > docs incorrect?
> >
> > ..David..
> >
> >
> >
> > FASTforward '07
> > The Industry's Largest Business &
> > Technology Conference Focused on Search February 7th - 9th, San 
> > Diego, CA www.fastforward07.com
> >
> >
>
>
> --
> Eric Redmond
> http://codehaus.org/~eredmond
>
>

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



FASTforward '07
The Industry's Largest Business &
Technology Conference Focused on Search
February 7th - 9th, San Diego, CA
www.fastforward07.com

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


Re: Activating a profile with settings.xml

Posted by Stephane Nicoll <st...@gmail.com>.
The current version is buggy. It does not display profiles that are
defined in the parent pom.

Stéphane

On 1/27/07, Eric Redmond <er...@gmail.com> wrote:
> Profiles should be activated in this way.
>
> Try: "mvn help:active-profiles"
> See if your profile is active.
>
> Eric
>
> On 1/26/07, David Jackman <dj...@fast.no> wrote:
> >
> > According to the documentation at http://maven.apache.org/settings.html:
> >     "Any profile id defined as an activeProfile will be active,
> > reguardless of any environment settings. If no matching profile is found
> > nothing will happen. For example, if env-test is an activeProfile, a
> > profile in a pom.xml (or profile.xml with a corrosponding id will be
> > active. If no such profile is found then execution will continue as
> > normal."
> >
> > However, I cannot get Maven to behave this way.  Should profiles defined
> > in the pom be able to be activated in this way, or are the docs
> > incorrect?
> >
> > ..David..
> >
> >
> >
> > FASTforward '07
> > The Industry's Largest Business &
> > Technology Conference Focused on Search
> > February 7th - 9th, San Diego, CA
> > www.fastforward07.com
> >
> >
>
>
> --
> Eric Redmond
> http://codehaus.org/~eredmond
>
>

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


Re: Activating a profile with settings.xml

Posted by Eric Redmond <er...@gmail.com>.
Profiles should be activated in this way.

Try: "mvn help:active-profiles"
See if your profile is active.

Eric

On 1/26/07, David Jackman <dj...@fast.no> wrote:
>
> According to the documentation at http://maven.apache.org/settings.html:
>     "Any profile id defined as an activeProfile will be active,
> reguardless of any environment settings. If no matching profile is found
> nothing will happen. For example, if env-test is an activeProfile, a
> profile in a pom.xml (or profile.xml with a corrosponding id will be
> active. If no such profile is found then execution will continue as
> normal."
>
> However, I cannot get Maven to behave this way.  Should profiles defined
> in the pom be able to be activated in this way, or are the docs
> incorrect?
>
> ..David..
>
>
>
> FASTforward '07
> The Industry's Largest Business &
> Technology Conference Focused on Search
> February 7th - 9th, San Diego, CA
> www.fastforward07.com
>
>


-- 
Eric Redmond
http://codehaus.org/~eredmond