Xel*_*ian 6 java encryption travis-ci sonarqube sonarcloud
我有java项目,我想将它与SonarCloud集成我遵循官方步骤:
使用SonarQube扫描仪检查代码#
在检查代码之前,您需要:
- 在SonarCloud上为您的帐户创建用户身份验证令牌.
- 加密此令牌travis加密abcdef0123456789或在存储库设置中定义SONAR_TOKEN
- 找到您想要推送项目的SonarCloud.io组织并获取其密钥
- 为您的项目创建一个sonar-project.properties文件(请参阅文档).然后将以下行添加到.travis.yml文件以触发分析:
在我的travis.yml文件中添加
addons:
sonarcloud:
organization: "xelian-github"
token:
secure: ${SONAR_TOKEN}
branches:
- master
script:
# other script steps might be done before running the actual analysis
- sonar-scanner
Run Code Online (Sandbox Code Playgroud)
其中SONAR_TOKEN是Travis CI上的变量,指向SonarCloud的密钥.(它未加密).
从SonarCloud我添加权限

但是当我开始travis构建时,我有以下错误:
Setting environment variables from repository settings
$ export SONAR_TOKEN=[secure]
....
ERROR: Error during SonarQube Scanner execution
ERROR: You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator.
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Run Code Online (Sandbox Code Playgroud)
在我看来,我的travis没有权限将结果上传到SonarCloud.是令牌中还是某些Sonar配置中的问题.
| 归档时间: |
|
| 查看次数: |
8120 次 |
| 最近记录: |