简体   繁体   English

在Maven中切换以打开/关闭Atlassian Clover

[英]Switch to turn on/off Atlassian Clover in Maven

I am using Clover via Maven during every build. 在每个构建过程中,我都通过Maven使用Clover。 The majority of the time the code coverage does not change much so I now do not want to have it run every time. 大多数时候,代码覆盖率不会发生太大变化,因此我现在不想每次都运行它。 Clover slows down the compilation a lot. Clover大大降低了编译速度。 Is there a maven switch that allows me to not run clover? 是否有Maven开关允许我不运行三叶草? It is run as a plugin so an alternative question is whether it is possible in Maven to disable some plugins with certain switches. 它作为插件运行,因此另一个问题是在Maven中是否可以通过某些开关禁用某些插件。

FYI the clover website is here for those of you who do not use it. 仅供参考,三叶草网站是为那些不使用它的人提供的。 http://www.atlassian.com/software/clover/overview http://www.atlassian.com/software/clover/overview

You should be able to accomplish this with profile activation and a custom property. 您应该能够通过配置文件激活和自定义属性来完成此任务。

If you surround your clover plugin with a profile and use profile activation, you can define the property on the command line when you want to run it. 如果将三叶草插件包含配置文件并使用配置文件激活,则可以在运行命令行时在命令行上定义属性。

<profiles>
  <profile>
    <activation>
      <property>
        <name>clover</name>
      </property>
    </activation>
    ...
  </profile>
</profiles>

Then, when calling maven, use -Dclover on the command line to activate the clover steps. 然后,在调用maven时,在命令行上使用-Dclover激活三叶草步骤。 If you don't provide the -Dclover then clover will not run. 如果不提供-Dclover,则三叶草将不会运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM