- Notifications
You must be signed in to change notification settings - Fork20
The Rule Designer is a graphical tool that helps PMD users develop their custom rules
License
pmd/pmd-designer
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The Rule Designer is a graphical tool that helps PMD users develop their customrules. Main features:
- AST inspection: inspect AST structure for any language, including XPath attributes
- XPath rule design: integrated XPath editor, and rule metadata editor
- Rule test edition: create or edit rule test files for thePMD testing framework
The designer is part of PMD's binary distributions. To install a distribution, see thedocumentation page about installing PMD.
The app needs either Oracle Java 8 (which includes JavaFX) or OpenJDK 11+ and a separately installedOpenJFX distribution. VisitJavaFX - Gluon to download an SDK distribution,extract it, and set theJAVAFX_HOME environment variable.
If thebin directory of your PMD distribution is on your shell's path, then you canlaunch the app with
pmd designeron Linux/ OSXpmd.bat designeron Windows
Alternatively, you can launch the program "from source" with Maven. There are two different ways
If you are running an OpenJDK buildwithout JavaFX bundled:
$ ./mvnw -Prunning exec:javawill launch the Designer after compiling it and add the JavaFX dependencies onthe classpath.
Note: JavaFX will be on the classpath and not module path, which might behave a bit differently.
You can change the version of those dependencies with e.g.-Dopenjfx.version=21.0.9for OpenJFX 21.See the list of available versionshere.If you are running an OpenJDK buildwith JavaFX bundled (e.g. Azul Zulu, Bellsoft Liberica):
$ ./mvnw -Prunning exec:java -Dopenjfx.scope=providedwill launch the Designer after compiling itwithout putting the JavaFX dependencies on the classpath.
Note: JavaFX will be on the module path and several packages need to be opened for reflection.Since everything (Maven, Designer) runs in the same JVM, the opened packages are defined in.mvn/jvm.config. Depending on the Java version, you might need additionallyMAVEN_OPTS="--enable-native-access=javafx.graphics --sun-misc-unsafe-memory-access=allow".
The latest version of the designer currentlyworks with PMD 7.0.0 and above.You can simply replacepmd-designer-7.X.Y.jar with thelatest buildin the installation folder of your PMD distribution.
SeeCONTRIBUTING.md for instructions to build the project from source and setup your IDE.
You can package a runnable jar containing the PMD dependencies with maven. Fornow the only option is to build a jar that contains pmd-core and pmd-java:
./mvnw clean package -Dfat-java -Dpmd.core.version=7.0.0-SNAPSHOTThepmd.core.version property selects the version of pmd-coreand pmd-javathat will be included. The built jar can then be found in yourtarget directory.Such a jar cannot be used in a PMD distribution and must be used in astandalone fashion, otherwise classpath conflicts may arise.You can additionally add-Dopenjfx.scope=compile to include openjfx as well.
You should never run theinstall goal with the-Dfat-java property! Thiswould install the fat jar in your local repo and may cause dependency conflicts.
About
The Rule Designer is a graphical tool that helps PMD users develop their custom rules
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors11
Uh oh!
There was an error while loading.Please reload this page.
