我尝试按照maven site中的示例启用maven个人资料。它以这种方式工作正常,这个代码在pom.xml中:
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.myco.plugins</groupId>
<artifactId>spiffy-integrationTest-plugin</artifactId>
<version>1.0</version>
<configuration>
<appserverHome>${appserver.home}</appserverHome>
</configuration>
</plugin>
...
</plugins>
</build>
...
</project>
此代码位于本地~/.m2/settings.xml
:
<settings>
...
<profiles>
<profile>
<id>appserverConfig</id>
<properties>
<appserver.home>/path/to/appserver</appserver.home>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>appserverConfig</activeProfile>
</activeProfiles>
...
</settings>
问题是如果我尝试更改激活方式:如果我尝试使用属性或activeByDefault
标记激活settings.xml上的配置文件,它什么都不做。如果我尝试在pom上以相同的方式激活配置文件它可以工作,但属性不会覆盖。
我该怎么办?