Maven jacoco检查中出错-参数';规则';丢失或无效

Maven jacoco检查中出错-参数';规则';丢失或无效,maven,testing,jacoco,jacoco-maven-plugin,jacoco-plugin,Maven,Testing,Jacoco,Jacoco Maven Plugin,Jacoco Plugin,这是我在运行mvn jacoco:check for a maven应用程序时遇到的错误。因此,不会生成报告 [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.3:check (default-cli) on project Netflix: The parameters 'rules' for goal org.jacoco:jacoco-maven-plugin:0.8.3:check are m

这是我在运行mvn jacoco:check for a maven应用程序时遇到的错误。因此,不会生成报告

 [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.3:check (default-cli) on project 

    Netflix: The parameters 'rules' for goal org.jacoco:jacoco-maven-plugin:0.8.3:check are missing or invalid -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.3:check (default-cli) on project Netflix: The parameters 'rules' for goal org.jacoco:jacoco-maven-plugin:0.8.3:check are missing or invalid
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
这是我在pom.xml中的jacoco插件。我想规则都没问题。我想知道少了什么

<plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.2</version>
            <executions>
                <execution>
                    <id>default-prepare-agent</id>
                    <phase>test</phase>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                    <configuration>
                        <!-- Sets the path to the file which contains the execution data. -->
                        <destFile>target/coverage-reports/jacoco-ut.exec</destFile>
                    </configuration>
                </execution>
                <execution>
                    <id>default-report</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
                <execution>
                    <id>default-jacoco-check</id>
                    <phase>test</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                    <configuration>
                        <rules>
                            <rule>
                                <element>PACKAGE</element>
                                <limits>
                                    <limit>
                                        <counter>LINE</counter>
                                        <value>COVEREDRATIO</value>
                                        <minimum>0.00</minimum>
                                    </limit>
                                    <limit>
                                        <counter>BRANCH</counter>
                                        <value>COVEREDRATIO</value>
                                        <minimum>0.00</minimum>
                                    </limit>
                                </limits>
                            </rule>
                        </rules>
                    </configuration>
                </execution>
                <execution>
                    <id>post-integration-test</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                    <configuration>
                        <dataFile>target/coverage-reports/jacoco-it.exec</dataFile>
                        <outputDirectory>target/coverage-reports/jacoco-it</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

org.jacoco
jacocomaven插件
0.8.2
默认准备代理
测试
配制剂
目标/覆盖率报告/jacoco-ut.exec
默认报告
测试
报告
默认jacoco检查
测试
检查
包裹
线
覆盖层
0
分支机构
覆盖层
0
整合后测试
整合后测试
报告
目标/覆盖率报告/jacoco-it.exec
目标/覆盖率报告/jacoco it
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

jacoco:check目标附加到Maven验证阶段。你也可以登记

您需要使用maven验证阶段来运行它

mvn clean verify

这回答了你的问题吗?