1

Does anyone know a jenkins plugin for Java that analyses the coding styles and fails the build (not only provide a report) in case there are styles violations?

L. Tudy
  • 37
  • 7

2 Answers2

1

You can use Findbugs and Checkstyle for the same.

https://plugins.jenkins.io/checkstyle

https://plugins.jenkins.io/findbugs

Jacoco is used to unit test coverage and not really for static analysis.

Durgadas Kamath
  • 400
  • 2
  • 12
0

the solution is to use a plugin of your build tool(like jacoco plugin in your pom for maven build).

And then configure your jenkins pipline to fail if quality is not satisfying

Lho Ben
  • 2,053
  • 18
  • 35
  • And how exactly I can configure jenkins to do so? – L. Tudy Dec 08 '18 at 21:02
  • refer to the answers of this question for more details https://stackoverflow.com/questions/40504535/how-to-react-on-sonarqube-quality-gate-within-jenkins-pipeline – Lho Ben Dec 08 '18 at 21:16