I am having trouble running a sonar analysis on my Windows Jenkins slave using sonar-runner. The sonar server works well when analysis is done locally, and I have already resolved errors with the database connection (database connection is working for master<->slave).
- Sonar version: 4.4
- Jenkins version: 1.59
- sonar-runner version: 2.4
- Jenkins sonar plugin version: 2.1
SONAR_RUNNER_HOME\conf\sonar-runner.properties:
sonar.host.url=http://master:9000
sonar.jdbc.url=jdbc:postgresql://master/sonar
sonar.sourceEncoding=UTF-8
sonar.jdbc.username=somelogin
sonar.jdbc.password=somepassword
sonar.login=somelogin
sonar.password=somepassword
sonar.java.source=1.7
Then, sonar-runner is run from Jenkins slave (sonar properties are set in jenkins job)
[project] $ C:\jenkins\sonar-runner-2.4\bin\sonar-runner.bat -Dsonar.jdbc.driver=org.postgresql.Driver ******** ******** -Dsonar.host.url=http://master:9000 ******** ******** -Dsonar.projectBaseDir=C:\jenkins\workspace\project -Dsonar.sourceEncoding=UTF-8 -Dsonar.dynamicAnalysis=reuseReports -Dtransformer.sonar.projectBaseDir=Transform -Dsonar.language=java -Dsonar.sources=src -Dsonar.junit.reportsPath=reports -Dsonar.libraries=lib -Dsonar.jacoco.reportPath=reports/jacoco -Dsonar.binaries=build/classes -Dsonar.projectVersion=1.0 -Dsonar.modules=controller,transformer,controlpanel -Dsonar.projectKey=project -Dcontrolpanel.sonar.projectBaseDir=ModeControlPanel -Dcontroller.sonar.projectBaseDir=Controller -Dsonar.tests=test -Dsonar.projectName=project
C:\jenkins\sonar-runner-2.4
SonarQube Runner 2.4
Java 1.7.0_55 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Runner configuration file: C:\jenkins\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\jenkins\workspace\project\.\.sonar
INFO: SonarQube Server 4.4
13:35:00.433 INFO - Load global settings
13:35:00.635 INFO - User cache: C:\.sonar\cache
13:35:00.646 INFO - Install plugins
13:35:01.017 INFO - Install JDBC driver
13:35:01.027 INFO - Create JDBC datasource for jdbc:postgresql://master/sonar
13:35:01.112 INFO - Initializing Hibernate
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 4.698s
Final Memory: 11M/248M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion, 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.
What the hey!? I have defined these properties!
I apologize for multi-module example, but I promise I have tried with single module and result is the same. Ideas?