-
Notifications
You must be signed in to change notification settings - Fork 18
Build PMD and test your new rule
-
Install Maven (
brew install maven
if you are using Homebrew) in order to executemvn
commands in your CLI. -
Before you are able to build PMD you have to create a toolchains.xml file. You can find more information about that in the official PMD README.
-
To build PMD navigate with your CLI to the root directory of PMD and execute
mvn clean package
. -
If the build fails you have to have a deeper look into the debug log to find and fix the root cause. Most of the time a test fails or the toolchains.xml file is invalid.
-
After successfully building PMD navigate to
/pmd/pmd-dist/target
and unzippmd-bin-*.*.*-SNAPSHOT.zip
. -
Run PMD
pmd-bin-*.*.*-SNAPSHOT/bin/run.sh pmd -d /files/to/analyse -f text -R apex-ruleset
. More information about running PMD via command line you can finde here.