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 Checkstyle plugin
Because Checkstyle operates on source code files, add the Checkstyle plugin to a chain that populates a workspace.
To configure the Checkstyle step:
Add the Checkstyle step to a chain, as described in Create chains.
Enter the plugin configuration details:
Field Description Title Enter a name for the plugin step or accept the default name. Configuration location
Select one of the following options:
The built-in configuration that uses the default configuration file.
- A local configuration file stored on the Agent (specified in the Configuration File Name field).
- A configuration file stored in a stream (specified in the Configuration File Name field).
Configuration name (Optional) Specify the path and filename of a configuration file that you created on the PulseUno server. Properties
(Optional) Specify environment properties. Enter each key-value pair on a new line, for example: