maven-plugins/pmd/xdocs/how-to.xml

69 lines
2.3 KiB
XML

<?xml version="1.0"?>
<document>
<properties>
<title>Maven PMD Plug-in How To</title>
<author email="siegfried.goeschl@it20one.at">Siegfried Goeschl</author>
</properties>
<body>
<section name="Maven PMD Plugin How To">
<subsection name="How to enable PMD for all of my projects?">
<p>
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
</p>
<p>
The simple way is to define the property in
$MAVEN_HOME/bin/driver.properties
</p>
</subsection>
<subsection name="How to disable PMD for one projects?">
<p>
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
</p>
</subsection>
<subsection name="How to get rid of zillions of rule violations?">
<p>
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.
</p>
<p>
In other case you change the trigger of the rules directly in the
ruleset files to fine tune the reports.
</p>
</subsection>
<subsection name="How to upgrade to a newer PMD jar?">
<p>
"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 ... ;-)
</p>
<p>
The JAR picked up the plugin is defined in
$MAVEN_HOME/plugins/pmd/project.xml and can be
changed.
</p>
<p>
Leave it, try it but don't whine will I have to carve
out a living with some paid work ... :-[]
</p>
</subsection>
</section>
</body>
</document>