Good day to you, Matt,
Thanks for the additional info.
Yes, plexus-utils Os.java is the one handling the comparison in the os
activation. Also, it is the reference that I use for [1] ( I placed it
under maven user since I don't have write access to the PLEXUS wiki ).
Furthermore, yes, the os.xxx are retrieved and converted to lowercase.
But I am not sure how the those are read from the xml file ( whether
modello reads those and converts in lowercase as well ). Also, os
activation does not seem to be case sensitive in my machine ( windows
xp ).
Anyway, you may want to update [1] as well :)
Thanks,
Franz
[1] http://docs.codehaus.org/display/MAVENUSER/Profiles
On 2/8/07, Matt Brozowski <[EMAIL PROTECTED]> wrote:
On Feb 6, 2007, at 1:58 PM, Graham Leggett wrote:
> Hi all,
>
> I've been trying to use profile activation based on OS to work
> around maven's lack of support for exposing the OS family (you can
> test against the current OS family, you just cannot find out what
> the current OS family is using ${maven.os.family} or some
> equivalent, or it least it seems that way from the users list).
<snip>
> The following variation does detect MacosX (using family instead of
> name):
>
> <profile>
> <id>activate-mac</id>
> <properties>
> <os-platform>macosx</os-platform>
> <os-arch>${os.arch}</os-arch>
> </properties>
> <activation>
> <os>
> <family>mac</family>
> </os>
> </activation>
> </profile>
<snip>
> But, as soon as you try and detect Linux and MacosX side by side,
> Linux is detected on MacosX, instead of MacOSX:
>
> <profile>
> <id>activate-linux</id>
> <properties>
> <os-platform>linux</os-platform>
> <os-arch>${os.arch}</os-arch>
> </properties>
> <activation>
> <os>
> <familylinux</family>
> </os>
I've done some research on this myself. The code this is actually
doing the checking is here is from plexus-utils. I believe the
version that is being used is :
http://svn.plexus.codehaus.org/browse/plexus/tags/plexus-utils-1.1/
src/main/java/org/codehaus/plexus/util/Os.java?r=3008
It turns out there is no linux family, there is only a 'unix' family
which includes Mac OS X (since the name ends with X)
The by name stuff does compare case sensitive with the lower cased
version of os.name, so you must use the all lower cased version.
This has been fixed in the latest version of plexus-utils version 1.4
Will maven-2.0.5 use the 1.4 version or an earlier one.
To solve the problem for my self... I use <family>mac</family> and
<name>linux<name> for the two profiles.
Hope that helps!
Matt Brozowski
________________________________________________________________________
___
Matt Brozowski, OpenNMS Maintainer Main: +1 919 812 4984
The OpenNMS Group, Inc. Fax: +1 503 961 7746
Email: [EMAIL PROTECTED] URL: http://www.opennms.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]