我有一个多Maven项目,并尝试通过报告协议和jacoco.exec的合并实施jacoco。我想使用jacoco插件0.7.9。但是我遇到了智利pom采用默认jacoco版本-0.7.5的问题,即使我在父母中明确提到了0.7.9。然后我特别提到了jacoco-plugin 0.7.9及其在智利pom之一中的执行-然后我可以看到该版本正在得到体现。
基本上,父jacoco插件版本不会在子pom中继承。有没有办法做。
下面是我的pom结构。
<modules>
<module>AA</module>
<module>BBB</module>
<module>CCC</module>
</modules>
<properties>
<maven.compiler.plugin>3.0</maven.compiler.plugin>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<guava.version>23.0</guava.version>
</properties>
<build>
<plugins>
<plugin>
<plugin>
<inherited>true</inherited>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<destFile>${basedir}/target/coverage-reports/jacoco.exec</destFile>
<dataFile>${basedir}/target/coverage-reports/jacoco.exec</dataFile>
<append>true</append>
</configuration>
<executions>
<execution>
<id>jacoco-agent-init</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<append>true</append>
<destFile>${project.build.directory}/jacoco.exec</destFile>
</configuration>
</execution>
<execution>
<id>default-report</id>
<phase>install</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
<execution>
<id>merge</id>
<phase>verify</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>..</directory>
<include>**/target/*.exec</include>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
</build>