目前我想在springboot项目里执行完命令:mvn test 单体测试后,生成Jacoco测试覆盖率报告,目前始终没有生成jacoco.exec 文件,以下是项目的一些代码和截图:
Java的版本是: 21
springboot的版本是:3.1.5
maven的版本是:3.8.8
pom.xml
```xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<forkCount>5</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Dnet.sf.ehcache.disabled=true</argLine>
</configuration>
</plugin>
<!--Jacoco plugin-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/jacoco/jacoco.exec</destFile>
</configuration>
</execution>
<execution>
<id>default-report</id>
<goals>
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco/jacoco.exec</dataFile>
<outputDirectory>${project.build.directory}/report/jacoco</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
执行完 mvn test命令后,后台编译成功,但会出现: Skipping JaCoCo execution due to missing execution data file. 的信息,项目
/target下也没有任何Jacoco的文件