gpt4 book ai didi

testing - Maven:在生命周期中跳过测试编译?

转载 作者:IT老高 更新时间:2023-10-28 11:12:06 25 4
gpt4 key购买 nike

我有一个项目,我设置为使用此设置使用 test-jar 和普通 jar 构建:

        <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>

问题是每当我在 pom 中升级项目版本时,我都需要使用测试进行构建,否则 maven 将无法在 期间找到具有正确版本的 test-jar测试编译 短语。很多时候我只想跳过测试,但由于缺少 test-jar,test-compile 短语将失败。

我尝试使用 -Dmaven.test.skip=true,但这似乎并没有跳过 test-compile 阶段。有没有办法跳过这个?

最佳答案

$ mvn clean install -Dmaven.test.skip=true \
-Dmaven.site.skip=true -Dmaven.javadoc.skip=true

关于testing - Maven:在生命周期中跳过测试编译?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5784778/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com