sanket
sanket

Reputation: 11

Jenkins Sonar Integration as post build action

I am unable to add Sonar as a post build action in Jenkins. When I try to add build action, I get the option "Execute SonarQube Scanner" but when I try to add post-build action, I dont get that option. Jenkins version - 2.39 SonarQube version - 5.6 SonarQube Scanner for jenkins plugin - 2.5

Upvotes: 0

Views: 3128

Answers (2)

G. Ann - SonarSource Team
G. Ann - SonarSource Team

Reputation: 22804

The Post Build Action is deprecated. You should use build steps. In this case, simply put the desired build step at the end of your build.

Upvotes: 1

Bruno Lavit
Bruno Lavit

Reputation: 10382

I think the best way to launch a Sonar analysis is to call Sonar as a Maven goal.

Here are my settings on Jenkins 1.6.

Build environnement section:

enter image description here

Maven goals:

mvn clean -U install findbugs:findbugs $SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL

And of course, you have to configure your Sonar instance in the global settings:

enter image description here

Upvotes: 1

Related Questions