图片未出现在 Jacoco 覆盖率报告中(既不在 Index.html 中也不在 VSTS 中)

Pictures are not appearing in Jacoco coverage report (neither in Index.html nor in VSTS)

我正在为 Maven 项目设置 Jacoco 覆盖范围。我想在 VSTS 中发布此报道。 我成功地获得了正确的覆盖,并且它已针对我项目的所有子模块发布,但图片没有出现(既不在 Jacoco 生成的 Index.html 文件中,也不在 VSTS 板中)。参见 screenshot。

你遇到过这样的问题吗?请问我该如何解决这个问题?

谢谢!

VSTS 管道中添加的任务:

  # Publish code coverage results
  # Publish Cobertura or JaCoCo code coverage results from a build
  - task: PublishCodeCoverageResults@1
    inputs:
      codeCoverageTool: 'JaCoCo'
      summaryFileLocation: '**/jacoco-ut/*.xml'
      reportDirectory: '**/jacoco-ut/'
      additionalCodeCoverageFiles: '**/coverage-reports/jacoco-ut.exec'
      failIfCoverageEmpty: false

聚合器模块的 POM 配置:

     <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <executions>
       <execution>
        <id>report-aggregate</id>
        <phase>prepare-package</phase>
         <goals>
          <goal>report-aggregate</goal>
         </goals>
       <configuration>
        <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
         <outputDirectory> ${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
       </configuration>
      </execution>
     </executions>
    </plugin>

Maven 父模块的 POM:

     <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <version>${jacoco.version}</version>
      <executions>
       <execution>
        <goals>
         <goal>prepare-agent</goal>
        </goals>
       </execution>
      </executions>
     </plugin>

对于每个子模块,POM 配置如下:

     <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <executions>
       <execution>
         <id>report</id>
        <phase>test</phase>
        <goals>
          <goal>report</goal>
        </goals>
       </execution>
      </executions>
     </plugin>

我发现这是出于安全考虑的VSTS限制。此处报告了同样的问题:https://developercommunity.visualstudio.com/content/problem/363333/jacoco-css-and-resources-missing-after-publishcode.html