Sonarqube:缺少“报告”参数

Pet*_*ock 6 windows msbuild sonarqube sonarqube-scan

我正在使用 MSBuild。我安装了 Java 8。

我正在运行以下命令:

SonarQube.Scanner.MSBuild.exe begin /k:"ABC" /d:sonar.host.url="http://localhost:9000"  /d:sonar.login="8b839xxxxxxxxxxxxxxxxxxxxxxx6b00125bf92"  /d:sonar.verbose=true

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" /t:rebuild

SonarQube.Scanner.MSBuild.exe end /d:sonar.login="8b839xxxxxxxxxxxxxxxxxxxxxxx6b00125bf92"
Run Code Online (Sandbox Code Playgroud)

最后一步失败:

ERROR: Error during SonarQube Scanner execution
ERROR: The 'report' parameter is missing
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
12:53:21.909  Creating a summary markdown file...
12:53:21.918  Post-processing failed. Exit code: 1
Run Code Online (Sandbox Code Playgroud)

MSBuild 版本大于 14。

Java 8 已正确安装。文档表明 Java 8 就足够了。

  1. 知道可能出什么问题吗?
  2. 在哪里添加 -X 开关?我尝试了所有 3 个语句

更新:我安装了 Java SDK 9。仍然是同样的问题。更新:使用详细日志记录并使用 /n 命名参数:

INFO: Analysis report generated in 992ms, dir size=4 MB
INFO: Analysis reports compressed in 549ms, zip size=1 MB
INFO: Analysis report generated in C:\ABC\.sonarqube\out\.sonar\scanner-report
DEBUG: Upload report
DEBUG: POST 400 http://localhost:9000/api/ce/submit?projectKey=ABC | time=1023ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 54.833s
INFO: Final Memory: 51M/170M
INFO: ------------------------------------------------------------------------
DEBUG: Execution getVersion
DEBUG: Execution stop
ERROR: Error during SonarQube Scanner execution
ERROR: The 'report' parameter is missing
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Process returned exit code 1
The SonarQube Scanner did not complete successfully
Creating a summary markdown file...
Post-processing failed. Exit code: 1
Run Code Online (Sandbox Code Playgroud)

noc*_*ame 5

我在 SonarQube 上遇到了同样的问题,终于找到了解决方案:使用评估令牌后需要重新启动声纳服务。


P.B*_*key 2

请注意,这不是答案,但我认为此反馈对于回答此问题很有价值。

  1. 我可以在 POSTMan 中通过 POST 请求重现此问题:

http://localhost:9000/api/ce/submit?projectKey=myProjectKey

这返回

{
    "errors": [
        {
            "msg": "The 'report' parameter is missing"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

通过删除查询参数,您可能会收到类似的错误projectKey。我尝试添加report查询参数并收到相同的错误:

http://localhost:9000/api/ce/submit?projectKey=brian3016&report=report

鉴于此,我觉得他们的代码有问题。它应该在创建 POST 请求时包含一个报告参数,但它没有这样做。

  1. 详细输出似乎已从使用-X开关更改为/d:sonar.verbose=true. 例如

SonarScanner.MSBuild.exe 开始 /k:"myProjectKey" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="myLogin" /d:sonar.verbose=true

请注意,详细的日志记录并没有给我任何有价值的见解。

(另请注意,文档当前说使用 SonarQube.Scanner.MSBuild.exe,但详细记录器告诉我切换到 SonarScanner.MSBuild.exe)

  1. 那么...我们如何向可以解决该问题的人报告此问题?他们的文档说要去 Stackoverflow。所以我们到了。

  2. 我认为这可能是项目的问题。因此,我创建了一个新项目,除了启动模板控制台应用程序之外什么都没有。同样的错误。