Use the Checkstyle bundled plugin to verify that Java code complies with a defined coding standard. The plugin uses the Checkstyle development tool to perform automated code checking. Checkstyle is highly configurable and can support most coding standards.
Create server configuration file
The Checkstyle libraries are embedded in the plugin, so there are no external tools to install.
To customize the Checkstyle rules to be checked by this plugin, create an XML configuration file on the PulseUno server in the following location:
The default file name is config.xml.
The Checkstyle plugin searches for a configuration file in the following sequence:
If the Configuration File Name field specifies a filename, the plugin looks for that file in this location:
- If the Configuration File Name field is empty, the plugin looks for config.xml in the same directory on the PulseUno server.
- If the Configuration File Name field is empty, and config.xml does not exist, the plugin uses a built-in configuration based on Sun Coding Conventions.
Configure plugin settings
Because Checkstyle operates on source code files, add the Checkstyle plugin to a chain that populates a workspace.
When adding the step to a chain, specify the following configuration details:
|Title||Enter a name for the step.|
|Configuration location||Select one of the following options:
|Configuration name||(Optional) Specify the path and filename of a configuration file that you created on the PulseUno server.|
(Optional) Specify environment properties. Enter each key-value pair on a new line, for example: