Hello,

I'm facing some behavior regarding activation of multiple profiles within a
pom.xml, which is contrary to what I was expecting. Maybe someone can help.

I have a pom consisting of three profiles:

<profiles>
        <profile><!-- Set tools.jar for most SUN JDKs. -->
                <id>default</id>
                <activation>
                        <activeByDefault>true</activeByDefault>
                </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>
                        <activeByDefault>false</activeByDefault>
                        <os>
                                <family>Mac</family>
                        </os>
                </activation>
                <properties>
                        <toolsJAR>${java.home}/../Classes/classes.jar</toolsJAR>
                </properties>
        </profile>
        <!--
        Add external dependency to StAX API (JSR-173) and Woodstox (which is an
        implementation of JSR-173). Both are not part of JDK 1.5. Starting from
        JDK 1.6 the built-in implementation is used.
        -->
        <profile>
                <id>jdk1.5</id>
                <activation>
                        <activeByDefault>false</activeByDefault>
                        <jdk>1.5</jdk>
                </activation>
                <dependencies>
                        <dependency>
                                <groupId>org.codehaus.woodstox</groupId>
                                <artifactId>woodstox-core-asl</artifactId>
                                <version>4.0.3</version>
                        </dependency>
                </dependencies>
        </profile>
</profiles>

What I want to achieve is that for platforms other than Mac OS _and_  Java
version 1.5.* the profiles "default" _and_ "jdk1.5" will be activated. For
platforms other than Mac OS _and_ Java 1.6 only the profile "default" should
be activated. Finally, for the Mac OS platform the profile "tools-jar-mac"
_and_ "jdk1.5" should be activated for Java 1.5; while only profile
"tools-jar-mac" should be activated for Java 1.6.

It seems to me that activation of profiles is exclusive, i.e., only one
profile is activated at a time. For instance, when using mvn
help:active-profiles on a Linux machine with Java 1.5 SDK, I see only
profile "jdk1.5" activated, but what I was expecting is that "default" would
be activated as well. Is there any way to achieve automatic activation of
multiple profiles apart from explicitly stating profiles via -P on the
command line.

-- Thorsten
-- 
View this message in context: 
http://www.nabble.com/Activation-of-multiple-profiles-at-the-same-time-tp22576838p22576838.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to