##### Overview

- Download PMD 5.0.4
- What's new in PMD 5.0.4
- PMD in the news
- PMD-related products and books
- Best practices
- Future directions
- Similar projects
- Credits
- License
- What does 'PMD' mean?

##### Usage

- Installation
- Command line usage
- Ant task usage
- Maven plugin usage
- Mvn plugin usage
- IDE plugin usage
- Suppressing warnings
- Finding duplicated code
- JSP support

##### Customizing PMD

- Compiling PMD
- How to write a rule
- Writing XPath rules
- How to make a rule set
- How it works
- Rule guidelines
- PMD developers information
- PMD Release Process

##### For example

- Run PMD on a Sourceforge project

##### Misc.

- XPath tutorial (Gregorian)

##### Rule Sets

- ecmascript
  - Basic Ecmascript
  - Braces
  - Unnecessary
- java
  - Android
  - Basic
  - Braces
  - Clone Implementation
  - Code Size
  - Comments
  - Controversial
  - Coupling
  - Design
  - Empty Code
  - Finalizer
  - Import Statements
  - J2EE
  - JavaBeans
  - JUnit
  - Jakarta Commons Logging
  - Java Logging
  - Migration
  - Naming
  - Optimization
  - Strict Exceptions
  - String and StringBuffer
  - Security Code Guidelines
  - Type Resolution
  - Unnecessary
  - Unused Code
- jsp
  - Basic JSF
  - Basic JSP
- xml
  - Basic XML
- xsl
  - XPath in XSL

##### Project Documentation

- Project Information
- Project Reports

## Requirements

- JDK 1.5 or higher
- Apache Maven 2 or later.

## Compiling PMD

You'll need to either check out the source code or download the latest source release. Assuming you've got the latest source release, unzip it to a directory:

    [tom@hal building]$ ls -l
    total 5716
    -rw-rw-r--    1 tom      tom       5837216 Jul 17 13:09 pmd-src-5.0.4.zip
    [tom@hal building]$ unzip -q pmd-src-5.0.4.zip
    [tom@hal building]$

Now cd down into the `pmd` directory:

    [tom@hal building]$ cd pmd-src-5.0.4
    [tom@hal pmd-src-5.0.4]$ ls -l | grep pom.xml
    -rw-rw-r--    1 tom      tom          29357 Jan 31 20:00 pom.xml
    [tom@hal pmd-src-5.0.4]$

That's the project configuration for maven... let's compile!

    [tom@hal pmd-src-5.0.4]$ mvn clean package
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building PMD 5.0.4
    [INFO] ------------------------------------------------------------------------
    [INFO]
    ...
    Results :

    Tests run: 829, Failures: 0, Errors: 0, Skipped: 9

    [INFO]
    [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ pmd ---
    [INFO] Building jar: target/pmd-5.0.4.jar
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1:41.062s
    [INFO] Finished at: Mon Apr 30 09:36:12 CEST 2012
    [INFO] Final Memory: 13M/187M
    [INFO] ------------------------------------------------------------------------
    [tom@hal pmd-src-5.0.4]$

Notes:

- The rules that have already been written are specified in the src/main/resources/rulesets/ directory in the source distribution. They're also in the jar file that's included with both the source and binary distributions.

A paucity of detail, I'm sure you'd agree. If you think this document can be improved, please post here and let me know how. Thanks!