Travis上的SonarCloud错误:未经授权。请检查属性sonar.login和sonar.password

问题描述 投票:3回答:2

我也在stackoverflow上搜索了很多有关此问题的内容,但没有找到解决方案。

直到昨天Travis可以执行声纳:声纳,没有任何问题,但是今天它不起作用,并且给了我这个错误:

--- 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以创建一个新的。但是什么都没有改变。这是我的Travis文件:

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而直接使用它,但没有任何更改。

谢谢您。

EDIT这是将-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]
travis-ci sonarcloud
2个回答
1
投票

似乎现在像您一样[[必须使用以下方法加密声纳令牌

travis encrypt
https://docs.travis-ci.com/user/sonarcloud/

过去,当令牌作为安全变量存储在Travis中时,它无需加密令牌即可工作。

或者,如果您使用变量来存储未加密的令牌,则可以更改.travis.yml文件。

addons: sonarcloud: organization: utplsql token: # Put sonar connection token generated and encrypted. secure: ${SONAR_TOKEN}

收件人:

addons: sonarcloud: organization: utplsql token: ${SONAR_TOKEN}

此解决方案对我有用。

0
投票
我有一个非常相同的问题:几分钟前它完全没问题,但它刚刚停止工作。

我唯一要做的就是将项目升级到Spring Boot 2.2.1,但似乎没有关系。

分析Travis构建日志时,我发现了类似的东西:

Not installing SonarSource build-wrapper because it's a Java or Javascript project /home/travis/.travis/job_stages: line 730: export: `decrypt]': not a valid identifier Preparing SonarQube Scanner parameters

完整链接:https://travis-ci.org/hycomsa/mokka/builds/609595402

我在成功构建中找不到它。Coudl,请检查您的日志?似乎是Travis问题...

© www.soinside.com 2019 - 2024. All rights reserved.