以下是我的 sonar.properties 文件:-
sonar.projectKey=code
sonar.projectName=PROJECT
sonar.projectVersion=0.0.1
sonar.sources=code
sonar.python.coverage.reportPath=code/coverage*.xml
sonar.python.coveragePlugin=cobertura
sonar.python.xunit.reportPath=TEST*.xml
sonar.sourceEncoding=UTF-8
sonar.pli.marginLeft=2
sonar.pli.marginRight=0
以下是我正在执行的命令:-
$HOME/sonar-scanner-3.2.0.1227-linux/bin/sonar-scanner -Dsonar.verbose=false -Dsonar.projectKey=code -Dproject.settings=code/devops/sonar.properties -Dsonar.host.url=https://mysonar.net -Dsonar.login=$USERNAME -Dsonar.password=$PASSWORD
错误日志:-
INFO: Python test coverage
INFO: Parsing report '/data/jenkins/workspace/master-ci/code/coverage.xml'
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 9.052s
INFO: Final Memory: 15M/397M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Line 3832 is out of range in the file code/src/driver.py (lines: 3831)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
Sonarqube 版本:- 7.1 版(内部版本 11001)LGPL v3Community 声纳扫描仪:- 3.2.0.1227