+ The following document contains the results of + PMD. +
+| Files | +Errors | +
|---|---|
| Files | +Violations | +
|---|---|
| + ${name} + | +
| Violation | +Line | +
|---|---|
|
+ |
+
+ |
+
+ Usually I provide a custom plugin, e.g. "maven-it20one-plugin-1.0" + which sets the variable "maven.pmd.enable" to "true". Since all + plugins are parsed it is guaranteed that PMD will be executed +
++ The simple way is to define the property in + $MAVEN_HOME/bin/driver.properties +
++ Assume that you have generated a DB layer having a few + hundreds Java source files. Apart from being curious you + don't want to have a PMD report for generated source files. + Simple put "maven.pmd.enable=false" into your project properties +
++ You could fix the rule violations. On the other hand I find + some of the rules quite annoying. Rules can be removed by editing + the rulesets.properties. +
++ In other case you change the trigger of the rules directly in the + ruleset files to fine tune the reports. +
++ "Those bloody contributors do not keep up with the + release - there is the new JAR out there for two + days and no update of the plugin ... having pizza, + coke, a joint and doing nothing" - Fine, as + long as we do not inhale ... ;-) +
++ The JAR picked up the plugin is defined in + $MAVEN_HOME/plugins/pmd/project.xml and can be + changed. +
++ Leave it, try it but don't whine will I have to carve + out a living with some paid work ... :-[] +
++ This plugin generates a report of the PMD static source code + analyzer. +
+ ++ Copy the downloaded plugin into the Maven plugin directory. + Any older version of the plugin should to be deleted to make + sure that the newest plugin is called +
+ ++ Download the PMD binary distribution and put the PMD + jar into the repository. This has to be done manually + unless PMD is hosted on the Maven remote repository. +
+ ++ Run "maven -g" and look out for documented PMD goals. + If you see some then the unpacking succeeded. +
+ ++ The PMD plugin can be started through "maven pmd" + or integrated by using the following code snippet in + maven.xml: +
+ ++ The generated report has to be added manually to the + website which is usually done with navigation.xml. +
+ ++ Another way to integrate the PMD plugin is to add it to the <reports> + section in your project.xml: +
+ ++ And last but not least - thanks to + Together Teamlösungen for + their support of Open Source Software and their contributions + such as Enhydra Application + Server 5.0 ("Aonyx") and a couple of Maven plugins. +
+ +| Property | +Optional? | +Description | +
|---|---|---|
| maven.pmd.enable | +No | ++ Enable/disable the PMD plugin. Has to be set to "true" + to enable the plugin + | +
| maven.pmd.rulesetfiles | +Yes | ++ Defines the rule to be used for running PMD. Is + already defined in the plugin + | +