-1

I am running checkstyle in an ANT task:

<taskdef resource="checkstyletask.properties" classpath="checkstyle-5.5//checkstyle-5.5-all.jar"/> 
<checkstyle config="checkstyle-5.5/sun_checks.xml" failOnViolation="false">
  <fileset dir="src/net" includes="**/*.java"/>
</checkstyle>

Anyways, the checkstyle is certainly running; I'm seeing a trememndous amount of output at the console. However, I do not see a checkstyle-results.xml file as output.

Of course, I'm assuming this is a severe error, and that checkstyle-results.xml is ALWAYS produced when checkstyle runs, by default. Is that correct? I believe that the results.xml file is required by Jenkins or Hudson CI plugins as well.

jayunit100
  • 17,388
  • 22
  • 92
  • 167
  • 1
    -1: it took me 2 seconds to find the answer by googling "checkstyle ant task" and clicking on the first result. – JB Nizet Dec 16 '11 at 21:10
  • Yup - for some reason, the "nested elements" heading threw me off. In any case - your answer was right on. Thanks – jayunit100 Dec 16 '11 at 21:40

2 Answers2

2

From http://checkstyle.sourceforge.net/anttask.html:

This task supports the nested elements fileset, classpath, formatter, and property.

The parameters for the formatter element are:

type

The type of output to generate. The valid values are:

plain - specifies the DefaultLogger
xml - specifies the XMLLogger

Defaults to "plain". No

toFile The file to write output to. Defaults to standard output. Note, there is no way to explicitly specify standard output.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
1

You need to specify the output in a formatter element; by default it goes to stdout.

http://checkstyle.sourceforge.net/anttask.html

Dave Newton
  • 158,873
  • 26
  • 254
  • 302