我正试图在eclipse环境中运行maven构建,但收到以下错误:
[ERROR]执行目标失败org.jacoco:jacoco-maven插件:0.6.1.201212231917:检查项目进度适配器:目标的参数"check"org.jacoco:jacoco-maven插件:0.6.1.201212231917:检查丢失或无效->[帮助1]org.apache.maven.lifecycle.LifecycleExecutionException:未能execute goal org.jacoco:jacoco-maven插件:0.6.1.201212231917:check项目进度适配器上的(check):目标的参数"check"org.jacoco:jacoco-maven插件:0.6.1.201212231917:检查丢失或在处无效org.apache.maven.hifecycle.internal.MojoExecution.execute(MojoExecutitor.java:221)在org.apache.maven.hifecycle.internal.MojoExecution.execute(MojoExecutitor.java:153)在org.apache.maven.hifecycle.internal.MojoExecution.execute(MojoExecutitor.java:145)
我不明白,因为这在不同工作区的另一个项目中有效。我将确切的jacoco配置复制到我的新项目pom中,它如下所示:
<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中运行的maven命令是
mvn clean install -e
有什么突出的地方吗?我已经想了一段时间了。当我从pom中删除所有这些时,我的项目会构建,但jacoco不会被选中。
谢谢Ryan
发现问题。"rules"参数用于jacoco 0.6.3及以上版本。正如你在我的错误中看到的,0.6.1被拉入。所以我添加了以下依赖