maven -> profile -> activation - all conditions are required or just one?

Viewed 1969

Configuration:
- Maven: 3.0.5
- Java: 1.6.0_45

Description:

Let's say we have profile configuration like below:

<profiles>
    <profile>
        <id>profile-1</id>
        <activation>
            <jdk>1.6</jdk>
            <property>
                <name>name</name>
                <value>Hubert</value>
            </property>
        </activation>
    </profile>
    <profile>
        <id>profile-2</id>
        <activation>
            <jdk>1.6</jdk>
            <property>
                <name>name</name>
                <value>Wiktoria</value>
            </property>
        </activation>
    </profile>
</profiles>

We have two profiles: profile-1 and profile-2.

Profile profile-1 should be active when two requirements are met:
- jdk is version 1.6
- property name has value Hubert

Question:

Let's check this configuration:

mvn -Dname=Hubert help:active-profiles

As a result I get that there are two active profiles: profile-1 and profile-2.
Hmm...
Profile profile-2 should not be active since property name has value different from expected Wiktoria.

Could someone explain me why this work like this? Is it a normal behavior?
Thanks.

2 Answers
Related