You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Steinar Bang <sb...@dod.no> on 2007/12/27 17:51:43 UTC

Is it possible to activate a profile from settings.xml?

Is it possible to activate a profile in the top POM from settings.xml?

What I want to do is to have a set of properties describing OS name, and
architecture of shared libraries (ie. redhat4 and x86, or win32 and
x86_64) for different build systems, and to have a single switch in
settings.xml, to set the right set of values for a configuration.

Is this possible to do?

Thanx!


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


Re: Is it possible to activate a profile from settings.xml?

Posted by Steinar Bang <sb...@dod.no>.
>>>>> "Tomasz Pik" <to...@gmail.com>:
> yes, add something like this:

> <activeProfiles>
>    <activeProfile>idOfProfile</activeProfile>
>    <activeProfile>idOfOtherProfile</activeProfile>
> </activeProfiles>

> listing profiles that needs to be activated at the end of settings.xml
> file (before </settings>).

So simple!  Thanx! :-)

I noted something strange on maven 2.0.4: I also needed a <profiles>
element in the settings.xml, containing a default profile (an empty
one), for the <activeProfiles> setting to "take".

Is that a known bug?  Or is it expected behaviour?  Is it changed/fixed
in later maven versions?

Thanx again!


- Steinar


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


Re: Is it possible to activate a profile from settings.xml?

Posted by Tomasz Pik <to...@gmail.com>.
On Dec 27, 2007 5:51 PM, Steinar Bang <sb...@dod.no> wrote:
> Is it possible to activate a profile in the top POM from settings.xml?
>
> What I want to do is to have a set of properties describing OS name, and
> architecture of shared libraries (ie. redhat4 and x86, or win32 and
> x86_64) for different build systems, and to have a single switch in
> settings.xml, to set the right set of values for a configuration.
>
> Is this possible to do?

yes, add something like this:

<activeProfiles>
   <activeProfile>idOfProfile</activeProfile>
   <activeProfile>idOfOtherProfile</activeProfile>
</activeProfiles>

listing profiles that needs to be activated at the end of settings.xml
file (before </settings>).

Regards,
Tomejk

>
> Thanx!
>
>
> ---------------------------------------------------------------------
> 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