gpt4 book ai didi

java - Maven + Clover + Jenkins - 如何在一个命令中获取覆盖率报告和非检测 Artifact

转载 作者:行者123 更新时间:2023-11-30 09:03:05 24 4
gpt4 key购买 nike

我正在尝试运行 maven clover 插件来生成报告以及生成非检测 Artifact 。

<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>3.1.3</version>
<configuration>
<generatePdf>true</generatePdf>
<generateHtml>true</generateHtml>
<licenseLocation>clover.license</licenseLocation>
<!-- the contextFilters element has to be specified within the reporting section and will not work if you specify it in the build section. -->
<!-- contextFilters>try,static,catch</contextFilters -->
</configuration>
</plugin>


mvn clean clover2:instrument clover2:clover install

如果我根据 clover doc 仪器目标运行上面的内容,它将在单独的生命周期中运行,并且不会影响默认的构建周期。确实如此,但问题是我想在默认构建生命周期中跳过测试。我尝试了以下操作,但它跳过了两个生命周期的测试。

mvn clean clover2:instrument clover2:clover install -DskipTests

如果上述工作正常,那么我可以在 jenkins 上简单地设置它,而无需为多个 maven 命令创建多个作业。

最佳答案

在单个神秘的 maven 命令中完成所有事情可能不是最好的主意(同样,将所有代码放在一个过程中也不是最好的主意)。为什么不将命令拆分为多个步骤或什至作业,从而相互触发?此外,从 CI 的角度来看,不同类型的工作要求不同的优先级以快速失败。我明白这不完全是一个答案。

关于java - Maven + Clover + Jenkins - 如何在一个命令中获取覆盖率报告和非检测 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25777329/

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