Skip to content

Build PMD and test your new rule

Robert Sösemann edited this page Jul 11, 2016 · 13 revisions
  1. Install Maven (brew install maven if you are using Homebrew) in order to execute mvn commands in your CLI.

  2. Create a Maven toolchains.xml file as described in the official PMD README.

  3. To build PMD navigate with your CLI to the root directory of PMD and execute mvn clean package.

  4. 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.

  5. After your build succeeds navigate to /pmd/pmd-dist/target directory.

  6. Unzip the generated pmd-bin-*.*.*-SNAPSHOT.zip.

  7. 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.