0
votes

Configuration:

  • SonarQube 5.1.2 with Build Stability plugin 1.3
  • Jenkins: 1.614
  • Maven: 3.2.2

I am attempting to use Build Stability with SonarQube and Jenkins. I added the Build Stability plugin to the ${SONARQUBE_HOME}/extensions/plugins directory and restarted the server. I see that the plugin is enabled in the SonarQube log. I added the Build Stability widget to the default project dashboard as described in documentation and this Stackoverflow answer. Since our Jenkins instance is secured via LDAP, I also supplied credentials for a user with permissions to access Jenkins. I put the Jenkins job URL in the ciManagement section of the POM.

Then I ran a build and fed metrics to SonarQube with a Jenkins Post Build action (calls mvn sonar:sonar). The build is successful and I see all other data in SonarQube - test results, coverage, etc. The job logs (which have debugging enabled) show all of the various sensors running. However, I do not see any data for the Build Stability plugin when I view my project in SonarQube. I also do not see an attempt to execute the Build Stability plugin in the job logs. I was hoping to see something like this in the job log (as shown here):

[INFO] [05:17:18.108] CI URL: Jenkins:http://<host>/job/<job-name>/

but there was nothing related to Build Stability. I then tried adding the URL to the project configuration in SonarQube, thinking perhaps I had the POM wrong. No difference. I have tested the Jenkins job URL and it works.

I also enabled debug logging on the SonarQube server. I see log entries for the job being run, but nothing specific to individual plugins.

At this point I'd be happy even to see a 401/403 error because that's farther than where I am now.

How do I get this plugin to run? What did I miss?

1

1 Answers

0
votes

While hunting for other possible solutions I found the -Dsonar.verbose option. I thought that might give me more clues, so added it to the Sonar configuration in Jenkins and re-ran the build. And now I see:

[INFO] [12:16:20.128] Sensor Build Stability
[INFO] [12:16:20.128] CI URL: https://host.com/job/jobName/
[WARN] [12:16:20.130] Unknown CiManagement system or incorrect URL: https://host.com/job/jobName/
[INFO] [12:16:20.130] Sensor Build Stability (done) | time=2ms

I had forgotten to put the "Jenkins:" part in front of the URL when I configured the Job URL in SonarQube.

It appears that BuildStability only works if the Job URL is explicitly configured. The plugin does not seem to retrieve the information from the ciManagement section of the POM (aggregator or parent), despite what the documentation says.