0
我在POM以下插件:行家聚甲醛 - 定义配置文件来定制插件配置
<plugin>
<groupId>com.github.klieber</groupId>
<artifactId>phantomjs-maven-plugin</artifactId>
<configuration>
<version>${phantomjs.version}</version>
<checkSystemPath>false</checkSystemPath>
<skip>${skipTests}</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
我想定义一个新的配置文件来定制插件配置:
<profile>
<id>enduserTest</id>
<properties>
<tomcat.version>8.0.39</tomcat.version>
<skipTests>true</skipTests>
</properties>
<build>
<defaultGoal>clean verify cargo:run</defaultGoal>
<plugins>
<plugin>
<groupId>com.github.klieber</groupId>
<artifactId>phantomjs-maven-plugin</artifactId>
<configuration>
<version>${phantomjs.version}</version>
<checkSystemPath>false</checkSystemPath>
</configuration>
<executions>
<execution>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
唯一不同的是<skip>${skipTests}</skip>
一行。 现在我想运行mvn -PenduserTest
,但配置不会被覆盖。 有什么建议吗?有没有更好的解决方案来做到这一点?这是正确的策略吗?
如果我定义的内部和外廓这些插件这是行不通的。但是,如果我只在配置文件中定义这些插件,它可以正常工作。 –