You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by TM <Th...@unibas.ch> on 2009/05/08 15:59:32 UTC
Undocumented Feature: Usage of negation for profile activation
Hello,
I just found a---to my best knowledge---undocumented feature and though I
should share it with the community in the hope that it will made its way
into the Maven documentation.
The feature is that you can use the negation symbol "!" within a profile
activation specifification not only to test the absence of a property but
also within the <os> tag, for instance, to express something like "activate
the profile if the OS family name is _not_ xyz". The following example
illustrates this:
<profiles>
<profile>
<id>tools-jar-windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<!-- ... -->
</profile>
<profile>
<id>tools-jar-unix</id>
<activation>
<os>
<!-- We need to exclude Mac OS X since it is in family 'unix' -->
<family>unix</family>
<name>!mac os x</name>
</os>
</activation>
<!-- ... -->
</profile>
<profile><!-- Mac OSX Java JDK doesn't has separate tools.jar. -->
<id>tools-jar-mac</id>
<activation>
<os>
<!-- We can not only use 'family' discriminator since Mac also has
'family = unix' -->
<family>unix</family>
<name>mac os x</name>
</os>
</activation>
<!-- ... -->
</profile>
<profiles>
So in this example I use <name>!mac os x</name> to specify that the profile
<id>tools-jar-unix</id> should be applied to all UNIX family operating
systems _except_ Mac OS X.
This example was tested with Maven 2.0.9, 2.0.10, 2.1.0 on Windows, Linux,
and Mac OS X and it works for all of them. Nice :-)
Cheers,
Thorsten
--
View this message in context: http://www.nabble.com/Undocumented-Feature%3A-Usage-of-negation-for-profile-activation-tp23446509p23446509.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Undocumented Feature: Usage of negation for profile activation
Posted by Brian Fox <br...@infinity.nu>.
They get better with patches ;-)
On Fri, May 8, 2009 at 5:57 PM, Martin Gainty <mg...@hotmail.com> wrote:
>
> fantastic..what are the chances of opening the capability to use regular
> expresssions?
>
> thanks,
> Martin Gainty
> ______________________________________________
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note
> de déni et de confidentialité
> This message is confidential. If you should not be the intended receiver,
> then we ask politely to report. Each unauthorized forwarding or
> manufacturing of a copy is inadmissible. This message serves only for the
> exchange of information and has no legal binding effect. Due to the easy
> manipulation of emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > From: wsmoak@gmail.com
> > Date: Fri, 8 May 2009 14:39:33 -0700
> > Subject: Re: Undocumented Feature: Usage of negation for profile
> activation
> > To: users@maven.apache.org
> >
> > On Fri, May 8, 2009 at 6:59 AM, TM <Th...@unibas.ch> wrote:
> > >
> > > Hello,
> > >
> > > I just found a---to my best knowledge---undocumented feature and though
> I
> > > should share it with the community in the hope that it will made its
> way
> > > into the Maven documentation.
> > >
> > > The feature is that you can use the negation symbol "!" within a
> profile
> > > activation specifification not only to test the absence of a property
> but
> > > also within the <os> tag, for instance, to express something like
> "activate
> > > the profile if the OS family name is _not_ xyz". The following example
> > > illustrates this:
> >
> > It could go on
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
> > .
> >
> > Can you open a JIRA issue if there isn't one, and possibly suggest a
> patch?
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> _________________________________________________________________
> Windows Live™: Keep your life in sync.
> http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009
RE: Undocumented Feature: Usage of negation for profile activation
Posted by Martin Gainty <mg...@hotmail.com>.
fantastic..what are the chances of opening the capability to use regular expresssions?
thanks,
Martin Gainty
______________________________________________
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> From: wsmoak@gmail.com
> Date: Fri, 8 May 2009 14:39:33 -0700
> Subject: Re: Undocumented Feature: Usage of negation for profile activation
> To: users@maven.apache.org
>
> On Fri, May 8, 2009 at 6:59 AM, TM <Th...@unibas.ch> wrote:
> >
> > Hello,
> >
> > I just found a---to my best knowledge---undocumented feature and though I
> > should share it with the community in the hope that it will made its way
> > into the Maven documentation.
> >
> > The feature is that you can use the negation symbol "!" within a profile
> > activation specifification not only to test the absence of a property but
> > also within the <os> tag, for instance, to express something like "activate
> > the profile if the OS family name is _not_ xyz". The following example
> > illustrates this:
>
> It could go on http://maven.apache.org/guides/introduction/introduction-to-profiles.html
> .
>
> Can you open a JIRA issue if there isn't one, and possibly suggest a patch?
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009
Re: Undocumented Feature: Usage of negation for profile activation
Posted by TM <Th...@unibas.ch>.
Wendy Smoak-3 wrote:
>
> It could go on
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
> .
>
> Can you open a JIRA issue if there isn't one, and possibly suggest a
> patch?
>
Done, cf. http://jira.codehaus.org/browse/MNGSITE-86
-- Thorsten
--
View this message in context: http://www.nabble.com/Undocumented-Feature%3A-Usage-of-negation-for-profile-activation-tp23446509p23480546.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Undocumented Feature: Usage of negation for profile activation
Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, May 8, 2009 at 6:59 AM, TM <Th...@unibas.ch> wrote:
>
> Hello,
>
> I just found a---to my best knowledge---undocumented feature and though I
> should share it with the community in the hope that it will made its way
> into the Maven documentation.
>
> The feature is that you can use the negation symbol "!" within a profile
> activation specifification not only to test the absence of a property but
> also within the <os> tag, for instance, to express something like "activate
> the profile if the OS family name is _not_ xyz". The following example
> illustrates this:
It could go on http://maven.apache.org/guides/introduction/introduction-to-profiles.html
.
Can you open a JIRA issue if there isn't one, and possibly suggest a patch?
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org