Domanda

I have a problem using Jenkins and Sonar. Here is my setup: a main linux server hosting Jenkins and Sonar and a windows vm to build a project. The windows vm is configured as a Jenkins slave, and the job I defined can successfully get project source and perform a ant build. But it fails at running Sonar analysis using sonar runner.

The error raised says "java.sql.SQLException: No database selected" and while looking at the console output, I see twice the jdbc url parameter:

... "-Dsonar.jdbc.url=jdbc:mysql://xxx.xx.xx.xxx:3306/sonar?userUnicode=true&characterEncoding=utf8" ... -Dsonar.jdbc.url=jdbc:mysql://xxx.xx.xx.xxx:3306 ...

So obviously the second parameter is the one used, and is missing the database name. If I change the second parameter and launch it from command line, it works fine.

The question is: why my parameter is overwritten and how can I change it?

Thanks for any help

È stato utile?

Soluzione

After several parameter modifications, my fix was simply to restart the Jenkins salve agent... As this is not a complete explanation, anyone with more details is welcome to post another answer.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top