You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2011/01/18 22:42:57 UTC

[jira] Closed: (MNG-4983) OS family detection incorrect when setting a profile on OSX

     [ http://jira.codehaus.org/browse/MNG-4983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MNG-4983.
----------------------------------

    Resolution: Not A Bug
      Assignee: Benjamin Bentmann

Unless there is some definitive doc around stating that "mac os x" is not a member of the "unix" family, this works as intended. And it seems the current behavior matches common sense, for instance {{SystemUtils.IS_OS_UNIX}} from commons-lang is true for OS X as well. Furthermore, this is the defacto behavior that users are used to when crafting their builds, i.e. changing this would cause severe compatibility issues, especially since OS-based profile activation does not only affect project builds but also dependency resolution.

To achieve the desired activations, you can use the following instead:
{code:xml}
<os>
  <family>unix</family>
  <name>!mac os x</name>
</os>
{code}


> OS family detection incorrect when setting a profile on OSX
> -----------------------------------------------------------
>
>                 Key: MNG-4983
>                 URL: http://jira.codehaus.org/browse/MNG-4983
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 3.0.2
>         Environment: OSX 10.6
>            Reporter: Andrew Westberg
>            Assignee: Benjamin Bentmann
>
> If I run mvn -version on OSX, the result is: 
> Apache Maven 3.0.2 (r1056850; 2011-01-08 19:58:10-0500)
> Java version: 1.6.0_22, vendor: Apple Inc.
> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> Default locale: en_US, platform encoding: MacRoman
> OS name: "mac os x", version: "10.6.6", arch: "x86_64", family: "mac"
> However, when running my actual project, a profile is being incorrectly set when I use OS family detection:
> <profiles>
>                 <profile>
>                         <id>win-build</id>
>                         <activation>
>                                 <os>
>                                         <family>windows</family>
>                                 </os>
>                         </activation>
>                         <properties>
>                                 <os.packaging>exe</os.packaging>
>                         </properties>
>                 </profile>
>                 <profile>
>                         <id>osx-build</id>
>                         <activation>
>                                 <os>
>                                         <family>mac</family>
>                                 </os>
>                         </activation>
>                         <properties>
>                                 <os.packaging>dmg</os.packaging>
>                         </properties>
>                 </profile>
>                 <profile>
>                         <id>tux-build</id>
>                         <activation>
>                                 <os>
>                                         <family>unix</family>
>                                 </os>
>                         </activation>
>                         <properties>
>                                 <os.packaging>deb</os.packaging>
>                         </properties>
>                 </profile>
>         </profiles>
> When I run mvn help:active-profiles, I'm getting both osx-build and tux-build profiles being activated:
> The following profiles are active:
>  - osx-build (source: pom)
>  - tux-build (source: pom)
>  - sli-profile (source: settings.xml)

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