I have installed SonarQube 4.2 -
it is running against Oracle XE
am running Jenkins on Tomcat 6.x
I have sonar configured with Jenkins ( NOT Sonar runner )
am trying to run a Jenkins job and then invoke Sonar through : "Invoke top level maven targets"
Here I am invoking the command:
-e clean install sonar:sonar -Dsonar.dynamicAnalysis=reuseReports -Dsonar.projectVersion=ABC-${BUILD_NUMBER} -Dsonar.forceAnalysis=true
The issue is that the job fails with the following exception:
INFO: SonarQube Server 4.2
[INFO] [16:10:29.258] Load batch settings
[INFO] [16:10:30.038] User cache: C:\Users\xyz\.sonar\cache
[INFO] [16:10:30.053] Install plugins
[INFO] [16:10:30.381] Install JDBC driver
[WARN] [16:10:30.381] H2 database should be used for evaluation purpose only
[INFO] [16:10:30.381] Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
[ERROR] Fail to connect to database
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Fail to connect to database
Connection refused: connect
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Fail to connect to database
I have checked sonar.properties and it is configured to work with OracleXE
My project that is executed has the following entry in its pom ( maven2 )
<plugin>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>4.2</version>
</plugin>
Thanks