I use Jenkins to test a Java software project (using a web playback platform, but that doesn't really matter).
Part of the test is about the code style for which I use checkstyle. I tried to set up my work as follows:
- I execute checkstyle through the command line that generates a report in xml
checkstyle -c /usr/share/checkstyle/sun_checks.xml -f xml -r app test -o checkstyle.xml
- Then I add a post-build action using this Jenkins plugin that reads the xml report and integrates into the build results
So now my problem is this: when there are any style issues in the code, Jenkins considers the job to be a failure. By default, the post-build action is not executed in this case.
You can change this so that the report is generated, however, although it still causes me an error that a bad code style is considered a failure. I think this is subjective. Anyway, is there a way to change this? And in general, how does Jenkins determine if the command shell is unsuccessful?
source share