Codacy不显示使用Travis-CI的覆盖范围

时间:2018-10-29 14:56:45

标签: java maven travis-ci codacy

我正在尝试将travis-ci与Codacy结合使用,但是travis向我返回以下错误:

Please visit http://docs.codecov.io/docs/supported-languages
after_success.2
1.11s$ java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r build/reports/jacoco/test/jacocoTestReport.xml
10/29 00:35:23 INFO  c.c.rules.ConfigurationRules:101 - Using API base URL: https://api.codacy.com 
10/29 00:35:23 ERROR c.c.CodacyCoverageReporter$:28 - File /home/travis/build/rjdesenvolvimento/apipessoas/build/reports/jacoco/test/jacocoTestReport.xml does not exist. 
Done. Your build exited with 0.

我的.travis.yml

dist: trusty
addons:
  sonarcloud:
    organization: "rjdesenvolvimento-github"
    token:
      secure: <token>
script:
- mvn sonar:sonar -Dsonar.projectKey=rjdesenvolvimento_apipessoas -Dsonar.organization=rjdesenvolvimento-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=51
after_success:
- bash <(curl -s https://codecov.io/bash)
- java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r build/reports/jacoco/test/jacocoTestReport.xml

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

您是否通过网站尝试过Codacy支持?似乎/home/travis/build/rjdesenvolvimento/apipessoas/build/reports/jacoco/test/jacocoTestReport.xml不存在,如何生成覆盖率?

Codacy插件只会上传覆盖率信息,您仍然需要生成该信息。

无论如何,请与Codacy支持部门联系,他们将为您提供帮助。