2013-08-07 51 views
1

我知道如何在Maven(在本地Eclipse或Jenkins中)使用Clover,问题是要求每个人将三叶草许可证放在同一个目录中,这不是一个好主意。有什么建议吗?如何在Maven和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 

回答

2

请参阅How to configure your 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>