2014-01-14 28 views
2

我想运行一个Maven构建在我的Eclipse环境中,我收到以下错误:jacoco:检查失败由于无效的参数

[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.6.1.201212231917:check (check) on project schedule-adapter: The parameters 'check' for goal org.jacoco:jacoco-maven-plugin:0.6.1.201212231917:check are missing or invalid -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jacoco:jacoco-maven-plugin:0.6.1.201212231917:check (check) on project schedule-adapter: The parameters 'check' for goal org.jacoco:jacoco-maven-plugin:0.6.1.201212231917:check are missing or invalid at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:221) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

我不明白,因为这工作在我的其他项目一个不同的工作区。我复制了确切jacoco配置到我的新项目聚甲醛,并将其内容如下:

<pluginManagement> 
     <plugins> 
<plugin> 
      <groupId>org.jacoco</groupId> 
      <artifactId>jacoco-maven-plugin</artifactId> 
      <version>${jacoco.version}</version> 
      <executions> 
      <execution> 
       <id>prepare-agent</id> 
       <goals> 
       <goal>prepare-agent</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>report</id> 
       <phase>prepare-package</phase> 
       <goals> 
       <goal>report</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>check</id> 
       <goals> 
       <goal>check</goal> 
       </goals> 
       <configuration> 
       <haltOnFailure>true</haltOnFailure> 
       <rules> 
        <rule> 
        <limits> 
         <limit> 
         <counter>INSTRUCTION</counter> 
         <value>COVEREDRATIO</value> 
         <minimum>0.75</minimum> 
         </limit> 
         <limit> 
         <counter>CLASS</counter> 
         <value>COVEREDRATIO</value> 
         <minimum>0.75</minimum> 
         </limit> 
         <limit> 
         <counter>METHOD</counter> 
         <value>COVEREDRATIO</value> 
         <minimum>0.75</minimum> 
         </limit> 
         <limit> 
         <counter>BRANCH</counter> 
         <value>COVEREDRATIO</value> 
         <minimum>0.75</minimum> 
         </limit> 
         <limit> 
         <counter>COMPLEXITY</counter> 
         <value>COVEREDRATIO</value> 
         <minimum>0.75</minimum> 
         </limit> 
         <limit> 
         <counter>LINE</counter> 
         <value>COVEREDRATIO</value> 
         <minimum>0.75</minimum> 
         </limit> 
        </limits> 
        </rule> 
       </rules> 
       </configuration> 
      </execution> 
      </executions> 
     </plugin> 
</plugins> 
</pluginManagement> 

我的行家命令在Eclipse中运行是

mvn clean install -e 

任何站出来的人?我一直试图弄清楚这一点。当我从我的pom中删除所有这些,我的项目建立,但jacoco没有被检查。

感谢 瑞安

回答

2

发现了这个问题。 “规则”参数用于jacoco 0.6.3及更高版本。正如你可以看到我的错误,0.6.1被拉入。所以我添加了以下依赖项

+0

以下依赖项...? – planty182

+0

不幸的是,它已经很久了,我甚至不知道我的代码在哪里使用它!但基本上确保jacoco版本是0.6.3及以上:) – 75inchpianist

相关问题