【发布时间】:2015-08-01 00:47:49
【问题描述】:
这是我的项目中pom.xml 的浓缩 sn-p
<profiles>
<profile>
<id>run-tests</id>
<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>pre-integration-test</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
......
</includes>
<replacements>
<replacement>
.......
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<configuration>
......
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<phase>integration-test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
我有两个问题:
1) 当我执行mvn clean package -Prun-tests 时,会发生什么?我预计这些插件目标都不会在这里执行,因为它们绑定到integration-test 阶段。但我看到这些目标为什么会执行?
2) 在execution 块中有两个目标是什么意思?请看上面failsafe-plugin
谢谢
【问题讨论】:
标签: maven maven-plugin maven-profiles maven-lifecycle