Using PMD Plug-in with Pramati Studio
PMD tool is a plug-in for Pramati Studio. It enables you to run PMD-1.5 tool to scan Java source code for potential problems like unused local variable, unused private methods etc, as defined in the rules set. Download PMD-1.5 executable and follow the instructions given in this document.
Importing PMD tool to Pramati Studio
To import PMD tool:
- Select Tools > Configure from the main menu.
- In the Configure panel, click Import Tool.
- In the File Chooser, browse and select the pmd.jar located in the lib\unsupported folder.
Configuring PMD
To configure PMD in Pramai Studio:
- Select File > IDE Options from the main menu.
- In the Options panel, select PMD. A new panel opens on the right. Provide the following information:
- In the PMD install directory, configure the installation directory of PMD-1.5 client. For example,
D:\downloads\pmd-1.5). As you choose this from the File Chooser, it will automatically configure the classpath of PMD.
- In the PMD Rules file location, configure the rule set file to be used. For example,
D:\downloads\rulesets\unusedcode.xml).
- In the Classpath of PMD configure all the jars present in the lib directory of the PMD-1.5 client.
Using PMD in Pramati Studio
Now, PMD tool can be used on the Java source files and directories creating Java Source files in the desk as follows:
- Right click on the the desk element and select Running PMD. This runs PMD-1.5 on the given Java file or all the Java source files if the selected node is a directory.
- While PMD is running, the output panel displays the running state and results are shown after execution. The output panel shows the results in a tree format with the name of the PMD file as root.
- Navigate to the violation line of the files by using navigation keys of output panel. If no violation is found, a message stating the same, appears.
- If any error comes in the execution or parsing ,the same is delegated to the user through the dialog box.