[英]Maven release plugin skipping tests on perform but not prepare
使用 maven 發布插件時, mvn release:prepare
和mvn release:perform
都將運行測試。
有什么辦法可以配置東西,讓它們只在mvn release:prepare
期間運行?
我知道你可以通過:
-Darguments="-DskipTests"
但這將跳過兩個目標期間的測試,這是我不想要的。 而且我也不希望它們僅在mvn release:perform
而不是 prepare 期間運行,因為執行期間的失敗已經標記了存儲庫。
您應該能夠通過將<releaseProfiles>
元素添加到 release-plugin 配置來做到這一點。 這將僅用於發布:執行 Mojo。
像這樣的事情應該可以解決問題:
<build>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<releaseProfiles>skipTestsForReleasePerform</releaseProfiles>
</configuration>
</plugin>
</plugins>
</build>
(...)
<profiles>
<profile>
<id>skipTestsForReleasePerform</id>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
</profiles>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.