CheckStyle is shown in the name of the Java program source code encoding style, is an indispensable tool for Java programmers to check if your coding habits are in line with the company's requirements or Sun's conventions. Of course, if you use IDE, there may be corresponding features or plugins to help programmers to do this.
As also shown in Checkstyle, it only checks, not Beautifier operation. Therefore, it should be more suitable for project management for DAILYBUILD. If you want to use the tool to come to Beautifier your Java source code, you can refer to I wrote.
Jalopy installation is installed.
Download and install
Wget http://umn.dl.sourceforge.net/sourceForge/checkstyle/checkstyle-3.4.tar.gz
TAR ZXVF Checkstyle-3.4.tar.gz
CD Checkstyle-3.4
At this point, CheckStyle itself and the JAR package they need are in this directory, usually we can only use Checkstyle-all-3.4.jar a package. The subdirectory CONTRIB has several XSL files, which is a style file for check the results.
Configure a check standard
Reference 2, for details, if you have made CheckStyle, I use it here is his profile. But Ant scripts, it is recommended to refer to me below, he has a small error (I have already said in his article.)
Automatic inspection of source code
The content of build.xml is as follows:
"$ {project.src.dir}" incrudes = "** / *. java" /> checkstyle> Now, run Ant Checkstyle-Nightly, if everything is normal, you will find the corresponding email in the mailbox of the recipient. Description: This build.xml is in the directory of ChechSty-3.4 by default, Checkstyle's configuration file is called mycheck.xml in the Contrib sub-directory; according to your Ant installation, you may need to copy JavaMail packets to $ Ant_home / lib . Reference: Checkstyle Home Page CHeckStyle Home Page CHECKSTYLE Unsignantly Ant installation, configuration