You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Thorsten Möller (JIRA)" <ji...@codehaus.org> on 2009/05/11 12:05:44 UTC

[jira] Created: (MNGSITE-86) Document usage of negation symbol for profile activation (undocumented feature)

Document usage of negation symbol for profile activation (undocumented feature)
-------------------------------------------------------------------------------

                 Key: MNGSITE-86
                 URL: http://jira.codehaus.org/browse/MNGSITE-86
             Project: Maven 2 Project Web Site
          Issue Type: Task
         Environment: *
            Reporter: Thorsten Möller


Please, document that the negation symbol "!" can be used for profile activation not only to test the absence of a property. This is currently not documented on this page:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

This request goes back to a thread on the Maven user list, cf.
http://www.nabble.com/Undocumented-Feature%3A-Usage-of-negation-for-profile-activation-td23446509.html

In the following I basically quote the original message posted to the forum; with some extensions to the example. The example can be almost directly added to the page to document and illustrate how this feature can be used:



Hello, 

I just found a---to my best knowledge---undocumented feature and thought 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> 
                <properties>
			<toolsJAR>${java.home}/../lib/tools.jar</toolsJAR>
		</properties> 
        </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> 
                <properties>
			<toolsJAR>${java.home}/../lib/tools.jar</toolsJAR>
		</properties>
        </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> 
                <properties>
			<toolsJAR>${java.home}/../Classes/classes.jar</toolsJAR>
		</properties> 
        </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 XP, Linux (Ubuntu 8.10), and Mac OS X 10.5.6 and it works for all of them. Nice :-) 

Cheers, 
Thorsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Updated: (MNGSITE-86) Document usage of negation symbol for profile activation (undocumented feature)

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNGSITE-86?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated MNGSITE-86:
---------------------------------

    Description: 
Please, document that the negation symbol "!" can be used for profile activation not only to test the absence of a property. This is currently not documented on this page:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

This request goes back to a thread on the Maven user list, cf.
http://www.nabble.com/Undocumented-Feature%3A-Usage-of-negation-for-profile-activation-td23446509.html

In the following I basically quote the original message posted to the forum; with some extensions to the example. The example can be almost directly added to the page to document and illustrate how this feature can be used:



Hello, 

I just found a---to my best knowledge---undocumented feature and thought 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: 

{code:xml}<profiles> 
        <profile> 
                <id>tools-jar-windows</id> 
                <activation> 
                        <os> 
                                <family>windows</family> 
                        </os> 
                </activation> 
                <properties>
			<toolsJAR>${java.home}/../lib/tools.jar</toolsJAR>
		</properties> 
        </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> 
                <properties>
			<toolsJAR>${java.home}/../lib/tools.jar</toolsJAR>
		</properties>
        </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> 
                <properties>
			<toolsJAR>${java.home}/../Classes/classes.jar</toolsJAR>
		</properties> 
        </profile> 
<profiles>{code} 

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 XP, Linux (Ubuntu 8.10), and Mac OS X 10.5.6 and it works for all of them. Nice :-) 

Cheers, 
Thorsten

  was:
Please, document that the negation symbol "!" can be used for profile activation not only to test the absence of a property. This is currently not documented on this page:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

This request goes back to a thread on the Maven user list, cf.
http://www.nabble.com/Undocumented-Feature%3A-Usage-of-negation-for-profile-activation-td23446509.html

In the following I basically quote the original message posted to the forum; with some extensions to the example. The example can be almost directly added to the page to document and illustrate how this feature can be used:



Hello, 

I just found a---to my best knowledge---undocumented feature and thought 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> 
                <properties>
			<toolsJAR>${java.home}/../lib/tools.jar</toolsJAR>
		</properties> 
        </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> 
                <properties>
			<toolsJAR>${java.home}/../lib/tools.jar</toolsJAR>
		</properties>
        </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> 
                <properties>
			<toolsJAR>${java.home}/../Classes/classes.jar</toolsJAR>
		</properties> 
        </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 XP, Linux (Ubuntu 8.10), and Mac OS X 10.5.6 and it works for all of them. Nice :-) 

Cheers, 
Thorsten


> Document usage of negation symbol for profile activation (undocumented feature)
> -------------------------------------------------------------------------------
>
>                 Key: MNGSITE-86
>                 URL: http://jira.codehaus.org/browse/MNGSITE-86
>             Project: Maven 2 Project Web Site
>          Issue Type: Task
>         Environment: *
>            Reporter: Thorsten Möller
>
> Please, document that the negation symbol "!" can be used for profile activation not only to test the absence of a property. This is currently not documented on this page:
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
> This request goes back to a thread on the Maven user list, cf.
> http://www.nabble.com/Undocumented-Feature%3A-Usage-of-negation-for-profile-activation-td23446509.html
> In the following I basically quote the original message posted to the forum; with some extensions to the example. The example can be almost directly added to the page to document and illustrate how this feature can be used:
> Hello, 
> I just found a---to my best knowledge---undocumented feature and thought 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: 
> {code:xml}<profiles> 
>         <profile> 
>                 <id>tools-jar-windows</id> 
>                 <activation> 
>                         <os> 
>                                 <family>windows</family> 
>                         </os> 
>                 </activation> 
>                 <properties>
> 			<toolsJAR>${java.home}/../lib/tools.jar</toolsJAR>
> 		</properties> 
>         </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> 
>                 <properties>
> 			<toolsJAR>${java.home}/../lib/tools.jar</toolsJAR>
> 		</properties>
>         </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> 
>                 <properties>
> 			<toolsJAR>${java.home}/../Classes/classes.jar</toolsJAR>
> 		</properties> 
>         </profile> 
> <profiles>{code} 
> 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 XP, Linux (Ubuntu 8.10), and Mac OS X 10.5.6 and it works for all of them. Nice :-) 
> Cheers, 
> Thorsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira