1
votes

I am using SonarQube Runner 2.4 at jenkins since today but the analysis fail with the message:

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

But sonar-project.properties of My_Project contain sonar.sources.

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

Where is the problem?

Greetings

2
I found a solution which will solve the problem. I have to add the property "MYProject.sonar.sources=src" In the project properties in Jenkins (I use "Invoke Standalone Sonar Analysis"). But this means the sonar-project.properties is not read correctly by sonar?Michael S

2 Answers

0
votes

Try adding "sonar.sources=." See if this works or not. Please add the log if the problem still persists.

0
votes

sonar.sources and sonar.binaries path should be relative to the sonar runner home. You need to check that of the path is right as just src.