Skip to content

Build PMD and test your new rule

David Renz edited this page Jun 13, 2016 · 13 revisions
  1. Install Maven (brew install maven if you are using Homebrew) in order to execute mvn commands in your CLI.

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

  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 successfully building PMD navigate to /pmd/pmd-dist/target and unzip pmd-bin-*.*.*-SNAPSHOT.zip.

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

Clone this wiki locally