我正在尝试将配置有vs代码(v1.57.0)的sonarlint(v2.0.0)连接到sonarqube服务器(v8.1)。java运行时(jre)8安装在我的计算机上。
我在vs代码中配置了工作区和用户设置,如下所示:
用户设置:
{
"sonarlint.connectedMode.connections.sonarqube": [
{
"serverUrl": "https://sonarqube.xxxx.com/",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
],
"sonarlint.output.showAnalyzerLogs": true,
"sonarlint.output.showVerboseLogs": true,
"sonarlint.ls.javaHome": "C:\\Program Files\\Java\\jdk1.8.0_291",
"java.home": "C:\\Program Files\\Java\\jdk1.8.0_291"
}
工作区设置:
{
"sonarlint.connectedMode.project": {
"projectKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
输出声纳:
[Debug - 21:49:17.115] Queuing analysis of file 'file:///c:/Users/mangobug/workspace/app/SomeResource.java'
[Debug - 21:49:17.119] Cached Java config for file 'file:///c:/Users/mangobug/workspace/app/SomeResource.java'
[Debug - 21:49:17.119] Skipping analysis of Java file 'file:///c:/Users/mangobug/workspace/app/SomeResource.java' because SonarLint was unable to query project configuration (classpath, source level, ...)
我已经检查了绑定,一切看起来都很好,但仍然跳过了java文件。我在网上浏览了多个解决方案,包括在项目中移动工作区设置、添加“serverid”、将java_home的路径添加到设置文件中、强制选择正确的jdk等等,但都没有成功。
暂无答案!
目前还没有任何答案,快来回答吧!