嗨,我正在使用Travis CI for Maven应用程序在SonarCloud上自动执行代码覆盖。

现在,在本地运行sonar:sonar命令在SoundCloud上提交报告,我可以通过Branch master看到如下所示的报告

maven - Travis CI SonarCloud错误 "Project was never analyzed. A regular analysis is required before a branch analysis"-LMLPHP

现在,我还配置了.travis.yml文件,如下所示将报告自动推送到每个构建版本的SoundCloud上

maven - Travis CI SonarCloud错误 "Project was never analyzed. A regular analysis is required before a branch analysis"-LMLPHP

但是,当Travis CI触发构建时,它将失败并显示以下错误

[INFO] Load project branches
[INFO] Load project branches (done) | time=114ms
[INFO] Load project pull requests
[INFO] Load project pull requests (done) | time=116ms
[INFO] Load branch configuration
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.884 s
[INFO] Finished at: 2019-05-19T16:47:23Z
[INFO] Final Memory: 93M/496M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project safenest-java-server:

 Project was never analyzed. A regular analysis is required before a branch analysis`

我是SonarCloud的新手,无法找到太多文档来寻求帮助。有人可以解释A regular analysis is required的确切含义吗?以及如何解决这个问题?

提前致谢。

最佳答案

您应该检查以下参数:

在Maven构建期间生成并在SonarCloud上生成的

  • Project key(或确保您设置在SonarCloud上生成的 sonar.projectKey 属性)。
  • 检查所提供的 token 值是否与SonarCloud上的 token 值匹配(您可以在项目设置页面上提供自己的值。
  • 关于maven - Travis CI SonarCloud错误 "Project was never analyzed. A regular analysis is required before a branch analysis",我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56210181/

    10-10 03:08