无法使用jacoco插件为RESTWebService项目生成junit覆盖率

nnsrf1az  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(191)

我已经为restwebservices编写了junit测试用例。所有的测试用例都通过了。但在index.html中,它的显示覆盖率是0%。请查找我正在使用的pom.xml:

<build>
    <finalName>RestDemo</finalName>
    <plugins>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.5</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
    </plugins>
</build>

项目结构:

你知道为什么每次的覆盖率都是0%吗?任何帮助都将不胜感激。
谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题