0

I have the following problem - I'm running a checkstyle ant task when building with Jenkins and the respective report DOES get produced, but the thing is that when the build finishes I get a message that there has been an error during the parsing because the error report has not been found. I verified that I have set the path to the report that is to be published to the right thing (when I change it to something slightly different I get a message that xxx does not exist but the path from the previous version does exist). Any idea what might be wrong? What format is Jenkins expecting in order to publish the checkstyle report? I'm using the following build.xml

 <taskdef
    classpath="libs/checkstyle-5.6-all.jar"
    resource="checkstyletask.properties" />

 <target name="checkstyle" >

        <checkstyle
            config="checkstyle.xml"
            failOnViolation="false" >

            <fileset
                dir="src"
                includes="**/*.java" />

            <formatter type="plain" />

            <formatter type="xml" />

            <formatter
                toFile="checkstyle-result.xml"
                type="xml" />
        </checkstyle>

        <style
            style="checkstyle-noframes.xsl"
            in="checkstyle-result.xml"
            out="checkstyle-result.html" />
    </target>

the config is the sun-checkstyle config.

Thanks for any help.

asenovm
  • 6,397
  • 2
  • 41
  • 52

2 Answers2

1

Try specifying **/checkstyle-result.xml as the result file location in your Jenkins job configuration; that will look through your entire build workspace for the result file. You can tighten up the file glob once you have things working.

If the above doesn't work, post the error message you're getting from Jenkins and the location of checkstyle-results.xml relative to your job's workspace directory.

gareth_bowles
  • 20,760
  • 5
  • 52
  • 82
  • The default path to the report (**/checkstyle-result.xml) actually worked so I ended up writing nothing as the path in which the report should be searched :D I had previously set it to /checkstyle-result.xml, but obviously that was wrong :/ Thanks for the help :) – asenovm Sep 25 '12 at 22:00
1

From the checkstyle plugin website:

The Checkstyle plug-in scans for checkstyle-result.xml files in the build workspace and reports the number of warnings found.

The plug-in should be looking for the checkstyle-result.xml XML formatted file. You don't mention in your question how you've configured the plugin, but if you are looking for checkstyle-result.html that may be the issue.

tschaible
  • 7,635
  • 1
  • 31
  • 34