1

我知道如何在 Maven 中进行 Clover(在本地 Eclipse 或 Jenkins 中),问题是要求每个人都将 clover 许可证放在同一目录中并不是一个好主意。有什么建议吗?

    <properties>
        <clover.version>3.1.8</clover.version>
        <clover.license>C:\xxx\clover_license</clover.license>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-clover2-plugin</artifactId>
                <version>${clover.version}</version>
                <configuration>
                    <license>${clover.license}</license>
                </configuration>
            </plugin>
        </plugins>
    </build>

我认为使用 Maven 参数来传递变量是可能的,但我需要在 Jenkins 的每个项目中设置它。如果我更改 Jenkins 服务器中的文件,我需要修改每个项目。

-Dclover.license=C:\xxx\clover_license
4

1 回答 1

2

请参阅如何配置您的 clover.license在此处获取建议。我建议建议“设置您的 .m2/settings.xml 文件”,这样您就可以定义该属性一次:

<profiles>
    <profile>
      <id>my-clover-profile</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
         <!-- You can define the path to a license file: -->
         <maven.clover.licenseLocation>/path/to/clover.license</maven.clover.licenseLocation>

         <!-- Or you can embed license key (remember to keep newline characters): -->
         <maven.clover.license><![CDATA[
            ...
         ]]></maven.clover.license>
      </properties>
   </profile>
</profiles>
于 2013-08-08T13:51:28.527 回答