<build>
<plugins>
<plugin>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-maven-pluginartifactId>
<version>2.1.3.RELEASEversion>
<configuration>
<mainClass>
com.fjn.OaApplication
mainClass>
configuration>
<executions>
<execution>
<goals>
<goal>repackagegoal>
goals>
execution>
executions>
plugin>
plugins>
build>




step1:启动jacoco
java -javaagent:jacocoagent.jar=includes=*,output=tcpserver,port=8080,adress=localhost,append=true -jar oasys-1.0-SNAPSHOT.jar
step2:生成exec文件
java -jar jacococli.jar dump --address 127.0.0.1 --port 6300--destfile oasys-1.0-SNAPSHOT.jar
step3:生成报表
java -jar jacococli.jar report ./jacoco-demo.exec --classfiles /Users/oukotoshuu/IdeaProjects/demo/target/classes/com --sourcefiles /Users/oukotoshuu/IdeaProjects/demo/src/main/java --html report --xml report.xml
step1:pom.xml文件中导入依赖
<dependency>
<groupId>org.jacocogroupId>
<artifactId>jacoco-maven-pluginartifactId>
<version>0.8.7version>
dependency>
<plugin>
<groupId>org.jacocogroupId>
<artifactId>jacoco-maven-pluginartifactId>
<version>0.8.7version>
<configuration>
<includes>
<include>com/**/*include>
includes>
configuration>
<executions>
<execution>
<id>pre-testid>
<goals>
<goal>prepare-agentgoal>
goals>
execution>
<execution>
<id>post-testid>
<phase>testphase>
<goals>
<goal>reportgoal>
goals>
execution>
executions>
plugin>
step2:运行

step3:得出报告

step4:导出报告
