Konfiguration:
- Maven: 3.0.5
- Java: 1.6.0_45maven -> Profil -> Aktivierung - alle Bedingungen sind erforderlich oder nur eine?
Beschreibung:
Lassen Sie uns sagen, dass wir Profilkonfiguration wie unten haben:
<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>
Wir haben zwei p rofiles: profile-1 und Profil-2.
Profil Profil-1 sollte aktiv sein, wenn zwei Voraussetzungen erfüllt sind:
- jdk ist Version 1.6
- Eigenschaft Name hat Wert Hubert
Frage:
Lassen Sie uns diese Konfiguration überprüfen:
mvn -Dname = Hubert Hilfe: aktiv-Profile
Als Ergebnis erhalte ich, dass es zwei aktive Profile: Profil-1 und Profil-2. Hmm
...
Profil Profil-2 sollte nicht aktiv sein, da Eigenschaft Name Wert hat sich von erwarteten Wiktoria.
Könnte mir jemand erklären, warum diese Arbeit wie das? Ist es ein normales Verhalten?
Danke.
Danke Chasmo für Ihre Antwort. Du hast recht. Prost. – Hubert
Dieses Problem (MNG-3328) ist jetzt hier: https://issues.apache.org/jira/browse/MNG-3328 – seanf