A general note - most plugins include the PMD jar files, which has the rulesets inside it. So even though the rulesets parameter that some plugins use (i.e., âcategory/java/bestpractices.xmlâ) looks like a filesystem reference, itâs really being used by a getResourceAsStream() call to load it out of the PMD jar files.
SummaryStatus column:
BlueJ is a teaching IDE. To install the PMD extension for BlueJ, download the PMDExecExt.jar file and place it in your bluej/lib/extensions/
directory.
To install the PMD plugin for Eclipse:
Alternatively, you can download the latest zip file and follow the above procedures except for using âNew local siteâ and browsing to the downloaded zip file.
To configure PMD, select âWindowsâ->âPreferencesâ, then select PMD.
To run PMD, right-click on a project node and select âPMDâ->âCheck code with PMDâ.
To run the duplicate code detector, right-click on a project node and select âPMDâ->âFind suspect cut and pasteâ. The report will be placed in a âreportsâ directory in a file called âcpd-report.txtâ.
To find additional help for other features, please read included help by selecting Help->Help Contents and browse the âHow toâ¦â section in the âPMD Plugin Documentationâ book.
After installing an update, if you get an Exception such as âjava.lang.RuntimeException: Couldnât find that class xxxxxâ, try deleting the ruleset.xml file in the .metadata/plugins/net.sourceforge.pmd.eclipse directory in your workspace.
To get Eclipse to not flag the @SuppressWarnings(âPMDâ) annotation, look under the menu headings Java -> Compiler -> Errors/Warnings -> Annotations -> Unhandled Warning Token.
EmacsIntegration with GNU Emacs is performed through an ELisp package, pmd.el. It supports two commands, âpmd-current-bufferâ and âpmd-current-dirâ. The output is captured in a compilation buffer which allows the user to âjumpâ directly to the source code position associated with the PMD warnings.
IntelliJ IDEA External ToolYou can use an integrated plugin or just use it as an IDEA âExternal Toolâ.
Hereâs how to set it up as an âExternal Toolâ:
c:\pmd\bin\pmd.bat
-d "$FilePath$" -f ideaj -R rulesets/java/quickstart.xml -P sourcePath="$Sourcepath$" -P classAndMethodName=$FileClass$.method -P fileName=$FileName$
Thatâs pretty much it. Now you can right click on a source directory and select PMD, itâll run recursively on the source files, and the results should be displayed in a window and hyperlinked into the correct file and line of code. I usually right-click on the message window title bar and unselect âautohideâ so the window doesnât go away every time I fix something in the code window.
IntelliJ IDEA - QAPlugQAPlug is an Intellij IDEA plugin to manage code quality. It integrates no less than Checkstyle, FindBugs, and PMD.
The plugin is available at https://qaplug.com/.
Also available at the JetBrains site, QAPlug-PMD and QAPlug.
JDeveloperTo install the PMD plugin for JDeveloper:
To run the PMD plugin for JDeveloper:
The way I use the JEdit plugin is:
Note that you can select individual rules by going to Utilities->Global Options->Plugin Options->PMD. Also, you can change the plugin to prompt you for a directory to check by going to that same menu and selecting the âAsk for Directoryâ checkbox.
TextPadAssumptions
D:\java\jdk\_142\
. This means that D:\java\jdk\_142\bin\java.exe
exists.D:\java\pmd-bin-\
. This means that D:\java\pmd-bin-\lib\pmd-.jar
(among other jar files in the same directory) exist.To integrate into TextPad
D:\java\jdk_142\bin\java.exe
and click the Open button. In the center pane of the Preferences dialog, an item âJavaâ has now been added, and is currently selected.+
â directly to its left.-classpath D:\java\pmd-bin-\lib\pmd-.jar;D:\java\pmd-bin-\lib\asm-3.2.jar;D:\java\pmd-bin-\lib\jaxen-1.1.1.jar net.sourceforge.pmd.PMD -d <i><b>$FileDir</b></i> -f net.sourceforge.pmd.renderers.TextPadRenderer -R E:\directory\my_pmd_ruleset.xml -debug
$FileDir
Checked
Checked
^\([^(]+\)(\([0-9]+\),
1
2
$FileDir
â with â$File
â, in the Parameters textbox.E:\directory\my_pmd_ruleset.xml
â with the ruleset of your choice. For example, basic
.Ctrl+Page Up
Ctrl+Page Down
To run PMD against a single Java file
Ctrl+Page Down
. This opens an empty, read-only text document (titled âCommand Resultsâ). When PMD completes its analysis, this document will be populated with a listing of violated rules (or âCommand completed successfullyâ indicating no violations).To run PMD against a directory of Java files
Ctrl+Page Up
. This opens an empty, read-only text document (titled âCommand Resultsâ). When PMD completes its analysis, this document will be populated with a listing of violated rules (or âCommand completed successfullyâ indicating no violations).Because directory analysis may take a while, you may choose to cancel this operation. Do so by closing the (blank Command Results) document, and then confirming that, âyes, I do really want to exit the toolâ.
Archived IntegrationsThese are integrations that are no longer maintained or for IDEs that no longer exist.
CodeGuideCodeGuide was a Java IDE by omnicore: https://web.archive.org/web/20081210063520/http://www.omnicore.com:80/en/codeguide.htm
GelGel was once an IDE: https://archive.org/details/tucows_246670_Gel
Source code for the PMD plugin is here: https://github.com/pmd/pmd-misc/tree/main/pmd-gel/
Hereâs how to set up the Gel plugin:
Thatâs pretty much it. Now you can open a Java project and click on Plugins->PMD and a configuration panel will pop up. You can pick which ruleset you want to run and you can also pick whether you want to run PMD on the current file or on every source file in your project.
JBuilderWas once a IDE by Borland (later Embarcadero): see https://en.wikipedia.org/wiki/JBuilder and https://web.archive.org/web/20090228184200/http://www.embarcadero.com/products/jbuilder/
Source code for the plugin is here: https://github.com/pmd/pmd-misc/tree/main/pmd-jbuilder/
To enable this OpenTool in JBuilder:
jbuilder/lib/ext/
directoryWhat you can do:
When running PMD, the results will be displayed in the MessageView under a tab called PMD Results. If you click on a violation message within this view, you will be taken to the line in the source code where the violation was detected.
Things still to do:
Was once a IDE: https://web.archive.org/web/20211018201200/http://www.jcreator.com/
To run PMD on a project, just pick pmd from the Tools menu.
WebLogic Workshop 8.1.xThatâs a plugin for an old version of Bea WebLogic Workshop 8.1.x (which is now available from Oracle). The new versions are based on Eclipse and donât require this plugin anymore.
Please see the WebLogic Workshop plugin project home page for more information.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4