为什么不工作 Jacoco?我希望我做的一切都是对的
Why don't work Jacoco? I hope I did everything right
https://github.com/Teemitze/TelegramBot
为什么不显示 Jacoco 统计信息?组装过程中出现警告
Skipping JaCoCo execution due to missing execution data file.
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<argLine>--enable-preview</argLine>
</configuration>
</plugin>
而与此处的许多其他问题类似,例如“Jacoco doesn't produce coverage reports" and quoting JaCoCo documentation:
If your project already defines VM arguments for test execution, be sure that they will include property defined by JaCoCo.
One of the ways to do this in case of maven-surefire-plugin - is to use syntax for late property evaluation:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -your -extra -arguments</argLine>
</configuration>
</plugin>
Another way is to define "argLine" as a Maven property rather than as part of the configuration of maven-surefire-plugin:
<properties>
<argLine>-your -extra -arguments</argLine>
</properties>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- no argLine here -->
</configuration>
</plugin>
https://github.com/Teemitze/TelegramBot
为什么不显示 Jacoco 统计信息?组装过程中出现警告
Skipping JaCoCo execution due to missing execution data file.
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<argLine>--enable-preview</argLine>
</configuration>
</plugin>
而与此处的许多其他问题类似,例如“Jacoco doesn't produce coverage reports" and quoting JaCoCo documentation:
If your project already defines VM arguments for test execution, be sure that they will include property defined by JaCoCo.
One of the ways to do this in case of maven-surefire-plugin - is to use syntax for late property evaluation:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <argLine>@{argLine} -your -extra -arguments</argLine> </configuration> </plugin>
Another way is to define "argLine" as a Maven property rather than as part of the configuration of maven-surefire-plugin:
<properties> <argLine>-your -extra -arguments</argLine> </properties> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <!-- no argLine here --> </configuration> </plugin>