错误:
[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.5:report-aggregate (report-aggregate) on project distribution: Unable to parse configuration of mojo org.jacoco:jacoco-maven-plugin:0.8.5:report-aggregate for parameter dataFileIncludes: Cannot assign configuration entry 'dataFileIncludes' with value '**/jacoco-unit.exec' of type java.lang.String to property of type java.util.List -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
pom.xml
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<id>report-aggregate</id>
<phase>prepare-package</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
<configuration>
<dataFileIncludes>**/jacoco-unit.exec</dataFileIncludes>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
我无法汇总所有模块并生成单个代码覆盖率报告
有人遇到这个问题吗? pom.xml中怎么了?
答案 0 :(得分:1)
错误表明dataFileIncludes
应该是一个列表。
这也是jacoco maven插件源代码中的defined。
因此,您可以尝试按照this document将其映射到列表:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<id>report-aggregate</id>
<phase>prepare-package</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
<configuration>
<dataFileIncludes>
<dataFileInclude>**/jacoco-unit.exec</dataFileInclude>
</dataFileIncludes>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>