TheX
TheX

Reputation: 327

How to run sonar analysis even if build failed on Jenkins

I have a jenkins job to build my project run tests and then run sonar with sonar jenkins-plugin. but when tests failed sonar analysis skipped.

Upvotes: 2

Views: 3996

Answers (2)

Upen
Upen

Reputation: 1438

You can use flexible publish plugin in Jenkins.

https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin

As a post build action, use Conditional action to "Always". Whatever be the previous step result, the action would be run. Select sonar analysis as the action.

enter image description here

Upvotes: 0

ppapapetrou
ppapapetrou

Reputation: 1663

You can trigger Sonar Analysis as a build step and not a post-build step. Take a look at this. But my question is, why you should want to run a quality analysis for a project failing its build?

Upvotes: 4

Related Questions