You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Manfred Moser <ma...@mosabuam.com> on 2010/11/13 00:02:08 UTC

Profile activation for mac and linux

Hi!

I would like to have a bunch of properties set differently for Mac, Linux
and Windows.

So I have inserted this
<profile>
            <id>linux</id>
            <activation>
                <os>
                    <family>unix</family>
                </os>
            </activation>
            <properties>
            </properties>
        </profile>
        <profile>
            <id>mac</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
            </properties>
        </profile>
        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
            </properties>
        </profile>

This works because on Linux only unix is activated and on the mac unix AND
mac are activated but the mac profile overrides the unix/linux values.

Now imho this is kind of error prone. With the wrong order it would not
work or if the order in a Maven version becomes random it might or might
not work.

So my question is if there is a better way and if I should file a bug
around this? Any thoughts?

manfred

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


Re: Profile activation for mac and linux

Posted by Carl-Erik Kopseng <ca...@gmail.com>.
I know this is an old thread, but for the lurkers of the internets, I might
post a possible answer. In stead of using "family" as the identifier, one
could use "name" - either in stead of or in addition to "family".

The following should thus be an unambigious activation

<activation> 
                <os> 
                    <family>unix</family> 
                    <name>Linux</name>
                </os> 
</activation> 

You can get the os name by running "mvn help:system |grep os.name"

--
View this message in context: http://maven.40175.n5.nabble.com/Profile-activation-for-mac-and-linux-tp3263043p5661715.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