Integrating Ant and Checkstyle

0 0
Read Time:34 Second

The Open Source Java code checker Checkstyle can be easily used by Ant to check your Java code.

This is an excerpt from an Ant build.xml file using the Sun Java coding checks:

   <property name="checkstyle.home" location="..."/>
   <taskdef resource="checkstyletask.properties" classpath="${checkstyle.home}/checkstyle-all-3.5.jar"/>
   <target name="checkstyle">
     <checkstyle config="${checkstyle.home}/sun_checks.xml" failOnViolation="false" classpathref="classpath">
       <fileset dir="${src.dir}" includes="**/*.java"/>
     </checkstyle>
   </target>

See also the manual of Checkstyle. Please note that JDeveloper has Audit Rules for Java code, but I do not know how to check those Rules with Ant.

About Post Author

Gert-Jan Paulissen

Senior Oracle architect / developer (PL/SQL & Apex) / DevOps engineer.I am happy to be able to combine work and hobby. Software engineer since 1989. Bridge player since 1977 and dutch champion more than 10 times.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %
Next Post

Book Review: Mastering Oracle PL/SQL: Practical Solutions

Title: Mastering Oracle PL/SQL: Practical Solutions Authors: Christoper Beck, Joel Kallman, Chaim Katz, David C. Knox, Connor McDonald Publisher: Apress ISBN: 1-59059-217-4 Publication Date: Dec 2003 Website: http://www.apress.com/book/bookDisplay.html?bID=276 More info can be found at the Publisher’s website. The source code is available for download. Related posts: ADF Faces – The […]
%d bloggers like this: