问题描述
我按照分析一个ant项目并得到以下错误:
I follow the instruction at Analyzing with SonarQube Scanner for Ant to analyzing an ant project and got following error:
Buildfile: C:\Projects\my-sonar\build.xml
[echo] Build properties read from build.properties
clean:
sonar:
[sonar:sonar] Apache Ant(TM) version 1.9.4 compiled on April 29 2014
[sonar:sonar] SonarQube Ant Task version: 2.5
[sonar:sonar] Loaded from: file:/C:/Projects/my-sonar/.ant/lib/sonarqube-ant-task-2.5.jar
[sonar:sonar] User cache: C:\Users\test\.sonar\cache
[sonar:sonar] Load global settings
BUILD FAILED
C:\Projects\my-sonar\build.xml:541: java.lang.IllegalStateException: Scanner engine is not started. Unable to execute task.
我正在使用JDK 1.8并连接到远程SonarQube服务器。
I'm using JDK 1.8 and connecting to a remote SonarQube server.
我是否必须在本地启动声纳扫描仪作为服务?
Do I have to start sonar-scanner as a service locally?
感谢任何帮助。
更新:
添加sonar.login& build.xml中的sonar.password。错误消息有点误导......
This works after adding "sonar.login" & "sonar.password" in build.xml. The error message is kind of misleading...
推荐答案
我从生产环境收到了完全相同的日志消息。配置适用于测试环境。问题是凭证。我同意您的更新,错误消息有点误导......
I received the exact same log message from the production environment. The configuration works in the test environment. The issue was credentials. I agree with your update, "The error message is kind of misleading..."
在我的情况下,sonar-project.properties文件中的SonarQube令牌不正确。我更正了令牌并成功重新进行了分析。
In my case the SonarQube token was incorrect in the sonar-project.properties file. I corrected the token and reran the analysis successfully.
这篇关于Sonar Scanner引擎未启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!