Jenkins SonarQube Runner 2.4无法在sonar-project.properties中找到sonar.sources,即使它存在
我从今天开始在jenkins使用SonarQube Runner 2.4,但分析失败,并显示以下信息:Jenkins SonarQube Runner 2.4无法在sonar-project.properties中找到sonar.sources,即使它存在,jenkins,sonarqube,sonar-runner,Jenkins,Sonarqube,Sonar Runner,我从今天开始在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.proper
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
但是sonar-project.My_项目的属性包含sonar.sources
sonar.language=java
sonar.projectName=My_Project
sonar.projectVersion=0.1
sonar.binaries=bin
sonar.projectDescription=
sonar.projectKey=MyProjectKey
sonar.sources=src
问题在哪里
问候语尝试添加“sonar.sources=”。看看这是否有效。如果问题仍然存在,请添加日志。sonar.sources和sonar.binaries路径应相对于sonar runner home。您需要检查路径是否正确,因为只有src。没有帮助。我在我的问题中添加了日志我想我发现了真正的问题,所以我创建了一个新问题:我找到了解决问题的解决方案。我必须在Jenkins的项目属性中添加属性“MYProject.sonar.sources=src”(我使用“Invoke Standalone sonar Analysis”)。但这意味着sonar无法正确读取sonar-project.properties?