0

我们目前使用 MSBuild Scanner 在构建时通过竹子进行静态代码分析。据我所知,Bamboo 插件目前不支持扫描仪,所以我使用的是命令行。

我想为分支机构启用它,以便我们可以在公司内收集更多信息,但是当我运行以下命令时:

msbuild-scanner begin /k:"project" /v:${bamboo.version}.${bamboo.buildNumber} /n:"project" /d:sonar.branch=${bamboo.shortPlanName}

我收到以下错误:

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:100)
    at org.sonar.runner.Main.executeTask(Main.java:70)
    at org.sonar.runner.Main.execute(Main.java:59)
    at org.sonar.runner.Main.main(Main.java:53)
Caused by: Insufficient privileges
ERROR: 
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
Post-processing failed. Exit code: 1

这是因为 project:branch 组合不存在。如果我创建项目并重新运行它就可以了。

Sonarqube 有没有办法允许在构建时创建项目?

4

1 回答 1

1

您需要授予运行分析的技术用户Create Projects权限。

于 2016-05-05T14:17:34.677 回答