我也在stackoverflow上搜索了很多关于这个问题的信息,但我没有找到解决方案。
直到昨天,Travis 可以毫无问题地执行 sonar:sonar,但今天它不起作用,它给了我这个错误:
--- sonar-maven-plugin:3.7.0.1746:sonar (default-cli) @ progetto ---
[INFO] User cache: /home/travis/.sonar/cache
[INFO] SonarQube version: 8.0.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Load global settings
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:38 min
[INFO] Finished at: 2019-11-08T15:56:40Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project progetto: Not authorized. Please check the properties sonar.login and sonar.password. -> [Help 1]
所以我改变了我的 SONAR_TOKEN 创建一个新的。但什么都没有改变。这是我的特拉维斯文件:
language: java
jdk: openjdk8
env: DISPLAY=:99.0
services:
- docker
- xvfb
addons:
sonarcloud:
organization: "laviniadd"
token:
secure: $SONAR_TOKEN
install: true
cache:
directories:
- $HOME/.m2
- $HOME/.sonar/cache
script:
- git fetch --unshallow
- mvn -f progetto/pom.xml clean verify -Pdocker -Pjacoco coveralls:report sonar:sonar
我真的不知道问题出在哪里。我也尝试生成一个新令牌并尝试直接使用它而不使用$SONAR_TOKEN
,但没有任何改变。
提前谢谢你。
编辑这是将 -X 添加到我的 travis 命令后的完整错误:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project progetto: Unable to load component class org.sonar.scanner.bootstrap.ScannerPluginInstaller: Unable to load component class org.sonar.scanner.bootstrap.PluginFiles: Unable to load component class org.sonar.scanner.bootstrap.GlobalConfiguration: Unable to load component class org.sonar.scanner.bootstrap.GlobalServerSettings: Not authorized. Please check the properties sonar.login and sonar.password. -> [Help 1]