3
votes

on the main page of a Jenkins job, I see the SonarQube icon, which should be a link, but it's just text: Jenkins job page with missing link

I use...

  • Jenkins 1.596.2 (also tried 1.609.1)
  • Jenkins SonarQube-Plugin 2.1 (also tried 2.2.1)
  • Maven 3.3.1
  • sonar-maven-plugin:2.6 (when configuring SonarQube post build action)
  • sonar runner 2.4 (when configuring SonarQube analysis build step)

After browsing the source code of the jenkins sonarqube-plugin, I found that SonarUtils.extractSonarProjectURLFromLogs() seems to be broken. It parses the console output for the regexp "ANALYSIS SUCCESSFUL, you can browse (.*)". My console output never prints this line. It just prints "ANALYSIS SUCCESSFUL".

Is this a known issue?

1
Which version of SonarQube are you running? And can you paste your analysis logs (the ones from Jenkins) on pastebin.com and add a link to them please? This is not normal that you only get the "ANALYSIS SUCCESSFUL".Fabrice - SonarSource Team
I am running SonarQube 4.1.2. Unfortunately our enterprise firewall blocks pastebin.com. So I can't paste the full console output.sradi
First lines of Post Build Action: [workspace] $ /usr/maven/apache-maven-3.3.1/bin/mvn -f /home/bldthla1/data/jenkins/jobs/zeus.core.vorschriften-2.0_jvm-reports-plugin/workspace/pom.xml -e -B sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.dynamicAnalysis=reuseReports -Dsonar.jdbc.url=jdbc:oracle:thin:@avo11.hhla.de:50017:AVO11 ******** ******** -Dsonar.host.url=vlxs030:9000 -Dsonar.branch=rel_2.0 ******** ********sradi
Last lines: [INFO] [08:42:55.725] Store results in database [INFO] [08:42:57.207] ANALYSIS SUCCESSFUL [INFO] [08:42:57.209] Executing post-job class org.sonar.plugins.buildbreaker.AlertBreaker [INFO] [08:42:57.211] Executing post-job class org.sonar.plugins.buildbreaker.ForbiddenConfigurationBreakersradi

1 Answers

3
votes

From what I can see in your logs, you are running the analysis in "preview" mode:

... -Dsonar.analysis.mode=preview ...

As you can read on the documentation about preview mode:

The source code is analyzed but the measures and issues are not pushed to the SonarQube database. Therefore, they cannot be browsed through the web interface.

So this is normal that you only get a ANALYSIS SUCCESSFUL message without the related SQ URL (because results are not pushed to the server in preview mode).