3

I am trying to run a maven build in my eclipse environment and I receive the following error:

[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)

I don't understand as this works in my other project in a different workspace. I copied the exact jacoco config over to my new project pom, and it reads as follows:

 <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>

My maven command from running in eclipse is

mvn clean install -e

Anything stand out to anyone? I've been trying to figure this out for a while. When I remove all of this from my pom, my project builds but jacoco is not checked.

Thanks Ryan

4

1 回答 1

3

发现了问题。"rules" 参数用于 jacoco 0.6.3 及更高版本。正如您在我的错误中看到的那样,正在拉入 0.6.1。所以我添加了以下依赖项

于 2014-01-14T04:41:43.620 回答