我有以下情況:Maven的配置文件定義的屬性
parent.pom
<profiles>
<profile>
<id>P1</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
whatever
</build>
</profile>
<profile>
<id>P2</id>
<activation>
<property>
<name>prop1</name>
</property>
</activation>
<build>
whatever
</build>
</profile>
有沒有,只有「MVN乾淨安裝」兒童激活曲線P2,而不需要像「MVN全新安裝指定配置文件的任何方式 - PP2「或」mvn clean install -Dprop1「或更改settings.xml?
prop1不是配置,或者它只是一個配置來激活配置文件P2。
我已經試過:
child.pom
<properties>
<prop1>exists</prop1>
</properties>
但如我所料,由於http://maven.apache.org/guides/introduction/introduction-to-profiles.html
那麼,有沒有人做過或者需要類似的東西它不工作?
你真的描述了無條件激活,在這種情況下,你應該爲配置文件'P2'設置''爲'true'(然後''配置文件'P1'和'P2'在默認情況下會被激活)。 –
mystarrocks
我可以有這種情況嗎? 2個配置文件默認是活動的 – mlecar
和''和''旨在用作驅動激活的條件,通常用於'',儘管如同'Maven 2.0.9'一樣,這些可以被內插。支持的變量是像'$ {user.home}'這樣的系統屬性和像'$ {env.HOME}'這樣的環境變量。 –
mystarrocks