【发布时间】:2018-10-25 00:16:24
【问题描述】:
我正在尝试设置 Gitlab CI。它正在工作,但我在尝试添加 Jacoco 代码覆盖率时遇到了问题。
我在 pom.xml 中的 Jacoco 插件就是这个。
...
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
....
我的 .gitlab-ci.yml 文件是这个。 ....
codecoverage:
image: kaiwinter/docker-java8-maven
script:
- mvn install -B
- cat target/site/jacoco/index.html
....
但是,我无法生成和显示代码覆盖率。我收到以下错误。
cat: target/site/jacoco/index.html: No such file or directory
请帮忙。
【问题讨论】:
标签: gitlab-ci jacoco jacoco-maven-plugin