Jenkins: missing SonarQube link on sidebar of work page

In the past, I configured Sonar in Jenkins by doing "Add action after build → SonarQube".

Now when I do this, I get this warning:

Using the SonarQube maven builder is no longer recommended. It is preferable to configure SonarQube in the build environment and use the standard Jenkins maven target program.

To fix this, I use this Maven plugin

<plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> <version>3.0.1</version> </plugin> 

and in the Jenkins assignment I accomplish the following goals

 -U clean test site sonar:sonar -Dsonar.host.url=http://my-sonar-server 

Everything works flawlessly, except that the link to the SonarQube is missing from the sidebar on the job page.

When I check the log, I see the SonarQube link: -

 [INFO] Analysis report generated in 162ms, dir size=52 KB [INFO] Analysis reports compressed in 47ms, zip size=27 KB [INFO] Analysis report uploaded in 81ms [INFO] ANALYSIS SUCCESSFUL, you can browse http://my-sonar-server/dashboard/index/org.project.test:test-webapp-war [INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report [INFO] More about the report processing at http://my-sonar-server/api/ce/task?id=AVJgoenzoxKSuOBz_89b [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:46 min [INFO] Finished at: 2016-01-20T14:02:50-06:00 [INFO] Final Memory: 67M/309M [INFO] ------------------------------------------------------------------------ 

It seems I can add do "Add build step → Invoke Standalone SonarQube Analysis", which will make this SonarQube link appear, but I need to specify all the analysis properties manually, and I find it very tedious since sonar-maven-plugin handles this easily for me.

My question is, using the sonar-maven-plugin and my goals above, how do I get Jenkins to display the SonarQube link in the sidebar of the job page?

I am using Jenkins 1.645 and SonarQube 5.3.

+6
source share
2 answers

Just check the “Sidebar Links” checkbox in the assembly configuration, as shown here , and place the sonar scan in your project.

+1
source
  • Go to Jenkins Management> Global Configuration
  • Check the box next to “Enable configuration of the Sonarqube server as a build environment variable” inside
  • Check "Prepare the SonarQube Scanner Environment" in the "Build Environment" section of the project configuration page.
0
source

All Articles