Ant CheckStyle Implementation Source: BEA Forum Powerise1 Checkstyle Introduction Checkstyle is a tool for developers to write Java code according to some habits, and he implements the automation of code checks, helping people liberate from this cumbersome work. The default provides support for Sun programming specification, but CheckStyle is a highly configurable, you can configure what you need to check according to your own requirements.
2 Tool Download, Installation 2.1 Ant Download the latest version 1.6.1, download address: http: //ant.apache.org/ Unzip to C: /ANT1.6.1, will reference the% ant_home% 2.2 CHESKStyle download latest version 3.3 , Download address: http://checkstyle.sourceforge.net/ Unzip to C: /Checkstyle3.3, will reference to% checkStyle_home% 3 Simple configuration 3.1 Environment variable: set path =% Ant_home% / binset classpath =% checkstyle_home % / checkStyle-all-3.3.jar3.2 build.xml file N Add Taskdef
! - Checkstyle configuration that checks the sun coding conventions from: - the Java Language Specification at http://java.sun.com/docs/books/jls/second_edition/html/index.html - the Sun Code Conventions at http: //java.sun.com/docs/codeconv/ - the javadoc guidiness at http://java.sun.com/j2se/javadoc/writingdoccomments/index.html - The JDK API Documentation http://java.sun.com /j2se/docs/api/index.html - some best practices Checkstyle is very configurable Be sure to read the documentation at http://checkstyle.sf.net (or in your downloaded distribution) Most Checks are configurable, be sure.. . to consult the documentation to completely disable a check, just comment it out or delete it from the file Finally, it is worth reading the documentation .-->
->
! - Modifier Checks ->