【发布时间】:2012-10-02 04:40:40
【问题描述】:
我们的 POM 文件中有以下配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
这确保了测试不会在 test 阶段执行。测试仅在集成测试阶段执行。
但是,当我们准备发布 (release:prepare) 时,maven 在 test 阶段执行测试。这会导致我们的构建失败,因为我们的测试只能在集成测试阶段运行(我们使用 tomcat-maven 插件在执行测试之前部署打包好的 war)。
我知道我们可以通过传递参数(-DskipTests 等)来跳过测试。我们不想跳过任何测试,我们只想 release:prepare 像任何其他 maven 目标一样执行。
非常感谢任何建议/帮助。
【问题讨论】:
标签: java jakarta-ee maven maven-2 maven-release-plugin