Usage: pmd [options]
  Options:
    -auxclasspath
       Specifies the classpath for libraries used by the source code. This is
       used by the type resolution. Alternatively, a 'file://' URL to a text file
       containing path elements on consecutive lines can be specified.
    -benchmark, -b
       Benchmark mode - output a benchmark report upon completion; default to
       System.err.
       Default: false
    -dir, -d
       Root directory for sources.
    -encoding, -e
       Specifies the character set encoding of the source code files PMD is
       reading (i.e., UTF-8).
       Default: UTF-8
    -format, -f
       Report format type.
       Default: text
    -help, -h, -H
       Display help on usage.
       Default: false
    -language, -l
       Specify a language PMD should use.
    -minimumpriority, -min
       Rule priority threshold; rules with lower priority than configured here
       won't be used. Default is '5' which is the lowest priority.
       Default: Low
    -property, -P
       {name}={value}: Define a property for the report format.
       Default: []
    -reportfile, -r
       Sends report output to a file; default to System.out.
  * -rulesets, -R
       Comma separated list of ruleset names to use.
    -shortnames
       Prints shortened filenames in the report.
       Default: false
    -showsuppressed
       Report should show suppressed rule violations.
       Default: false
    -stress, -S
       Performs a stress test.
       Default: false
    -suppressmarker
       Specifies the string that marks the a line which PMD should ignore;
       default is NOPMD.
       Default: NOPMD
    -threads, -t
       Sets the number of threads used by PMD.
       Default: 1
    -uri, -u
       Database URI for sources.
    -debug, -verbose, -D, -V
       Debug mode.
       Default: false
    -version, -v
       Specify version of a language PMD should use.


Mandatory arguments:
1) A java source code filename or directory
2) A report format 
3) A ruleset filename or a comma-delimited string of ruleset filenames

For example: 
C:\>pmd-bin-5.3.7\bin\pmd.bat -d c:\my\source\code -f html -R java-unusedcode

Languages and version suported:
xsl, jsp, vm, java, ecmascript, plsql, xml

Available report formats and their configuration properties are:
   codeclimate: Code Climate integration.
   csv: Comma-separated values tabular format.
        problem - Include Problem column   default: true
        package - Include Package column   default: true
        file - Include File column   default: true
        priority - Include Priority column   default: true
        line - Include Line column   default: true
        desc - Include Description column   default: true
        ruleSet - Include Rule set column   default: true
        rule - Include Rule column   default: true
   emacs: GNU Emacs integration.
   html: HTML format
        linePrefix - Prefix for line number anchor in the source file.
        linkPrefix - Path to HTML source.
   ideaj: IntelliJ IDEA integration.
        classAndMethodName - Class and Method name, pass '.method' when processing a directory.   default: 
        sourcePath - Source path.   default: 
        fileName - File name.   default: 
   summaryhtml: Summary HTML format.
        linePrefix - Prefix for line number anchor in the source file.
        linkPrefix - Path to HTML source.
   text: Text format.
   textcolor: Text format, with color support (requires ANSI console support, e.g. xterm, rxvt, etc.).
        color - Enables colors with anything other than 'false' or '0'.   default: yes
   textpad: TextPad integration.
   vbhtml: Vladimir Bossicard HTML format.
   xml: XML format.
        encoding - XML encoding format, defaults to UTF-8.   default: UTF-8
   xslt: XML with a XSL Transformation applied.
        encoding - XML encoding format, defaults to UTF-8.   default: UTF-8
        xsltFilename - The XSLT file name.
   yahtml: Yet Another HTML format.
        outputDir - Output directory.

For example on windows: 
C:\>pmd-bin-5.3.7\bin\pmd.bat -dir c:\my\source\code -format text -R java-unusedcode,java-imports -version 1.5 -language java -debug
C:\>pmd-bin-5.3.7\bin\pmd.bat -dir c:\my\source\code -f xml -rulesets java-basic,java-design -encoding UTF-8
C:\>pmd-bin-5.3.7\bin\pmd.bat -d c:\my\source\code -rulesets java-typeresolution -auxclasspath commons-collections.jar;derby.jar
C:\>pmd-bin-5.3.7\bin\pmd.bat -d c:\my\source\code -f html -R java-typeresolution -auxclasspath file:///C:/my/classpathfile

For example on *nix: 
$ pmd-bin-5.3.7/bin/run.sh pmd -dir /home/workspace/src/main/java/code -f html -rulesets java-basic,java-design
$ pmd-bin-5.3.7/bin/run.sh pmd -d ./src/main/java/code -f xslt -R java-basic,java-design -property xsltFilename=my-own.xsl
$ pmd-bin-5.3.7/bin/run.sh pmd -d ./src/main/java/code -f html -R java-typeresolution -auxclasspath commons-collections.jar:derby.jar




