简体   繁体   English

Sonar Runner不使用sonar-project.properties的属性

[英]Sonar Runner does not use properties of sonar-project.properties

I am using SonarQube Runner 2.4 at jenkins since today but the analysis fail with the message: 从今天开始,我就在jenkins使用SonarQube Runner 2.4,但是分析失败并显示以下消息:

SonarQube Runner 2.4
Java 1.7.0_51 Oracle Corporation (64-bit)
INFO: Runner configuration file: /.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonar_Runner_2.4/conf/sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "ISO-8859-1" (analysis is platform dependent)
INFO: Work directory: /.jenkins/workspace/Sonar/.sonar
INFO: SonarQube Server 4.3.2
23:21:42.176 INFO  - Load batch settings
23:21:42.160 INFO  - User cache: /.sonar/cache
23:21:42.270 INFO  - Install plugins
23:21:43.322 INFO  - Install JDBC driver
23:21:43.329 INFO  - Create JDBC datasource for jdbc:mysql://xxx
23:21:45.505 INFO  - Initializing Hibernate
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 5.214s
Final Memory: 21M/429M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: You must define the following mandatory properties for ‚com.mypackage:MyProject: sonar.sources
ERROR: 
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
[BFA] Scanning build for known causes...

[BFA] Done. 0s
Notifying upstream projects of job completion
Finished: FAILURE

If I add the property "MyProject.sonar.sources=src" In the project properties in Jenkins (I use "Invoke Standalone Sonar Analysis"). 如果我在Jenkins的项目属性中添加属性“ MyProject.sonar.sources = src”(我使用“调用独立声纳分析”)。 I will receive the error message 我会收到错误消息

ERROR: Caused by: Findbugs needs sources to be compiled. Please build project before executing sonar and check the location of compiled classes.

This means the sonar-project.properties (/.jenkins/workspace/Deploy/MyProject/sonar-project.properties) is not read or used because there are all values defined: 这意味着未读或使用sonar-project.properties(/.jenkins/workspace/Deploy/MyProject/sonar-project.properties),因为定义了所有值:

sonar.language=java
sonar.projectName=MyProject
sonar.projectVersion=0.1
sonar.binaries=bin
sonar.projectDescription=
sonar.projectKey=MyProjectKey
sonar.sources=src

When sonar is executed I can see the correct path to MyProject where : -DMyProject.sonar.projectBaseDir=/.jenkins/workspace/Deploy/MyProject 执行声纳时,我可以看到MyProject的正确路径,其中:-DMyProject.sonar.projectBaseDir = /。jenkins / workspace / Deploy / MyProject

Or does the name of sonar-project.properties changed? 还是sonar-project.properties的名称更改了?

Please build the project in the release mode. 请在发布模式下构建项目。 After the build happens you will get the dll's produced somewhere. 构建完成后,您将在某个地方生成dll。 you have to point to that location. 您必须指向该位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM