Author: mperham
Date: Wed Jul 5 12:16:38 2006
New Revision: 419318
URL: http://svn.apache.org/viewvc?rev=419318&view=rev
Log:
PR: MPMD-34
Plugin documentation update
Added:
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt
- copied, changed from r419305,
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/overview.apt
Removed:
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/generatingPmdAndCpd.apt
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/overview.apt
Modified:
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/usingRuleSets.apt
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/violationChecking.apt
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/faq.apt
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/usage.apt
maven/plugins/trunk/maven-pmd-plugin/src/site/site.xml
Modified:
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java?rev=419318&r1=419317&r2=419318&view=diff
==============================================================================
---
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
(original)
+++
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
Wed Jul 5 12:16:38 2006
@@ -73,7 +73,7 @@
* See the net.sourceforge.pmd.renderers package javadoc for available
renderers.
* XML is required if the pmd:check goal is being used.
*
- * @parameter expression="${format}"
+ * @parameter expression="${format}" default-value="xml"
*/
protected String format = "xml";
Modified:
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/usingRuleSets.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/usingRuleSets.apt?rev=419318&r1=419317&r2=419318&view=diff
==============================================================================
---
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/usingRuleSets.apt
(original)
+++
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/usingRuleSets.apt
Wed Jul 5 12:16:38 2006
@@ -10,7 +10,8 @@
Using Rule Sets
The PMD plugin uses three default rule sets: basic.xml, unusedcode.xml and
imports.xml. These rule sets are bundled in
- the PMD code analysis tool. To use other rule sets, you can configure the
plugin as shown below:
+ the PMD code analysis tool
({{{http://pmd.sourceforge.net/rules/index.html}more info}}). To use other
+ rule sets, you can configure the plugin as shown below:
+-----+
<reporting>
Modified:
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/violationChecking.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/violationChecking.apt?rev=419318&r1=419317&r2=419318&view=diff
==============================================================================
---
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/violationChecking.apt
(original)
+++
maven/plugins/trunk/maven-pmd-plugin/src/site/apt/examples/violationChecking.apt
Wed Jul 5 12:16:38 2006
@@ -4,7 +4,6 @@
23 June 2006
------
-
Violation Checking
Modified: maven/plugins/trunk/maven-pmd-plugin/src/site/apt/faq.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/site/apt/faq.apt?rev=419318&r1=419317&r2=419318&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/site/apt/faq.apt (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/site/apt/faq.apt Wed Jul 5
12:16:38 2006
@@ -1,26 +1,22 @@
------
FAQs
------
- Maria Odea Ching
+ Mike Perham
------
30 June 2006
------
-
-
FAQs
- Below are frequently asked questions for the PMD plugin:
-
* The PMD report takes a long time to generate. Is there any way to skip the
PMD or CPD reports temporarily?
- Yes, each report supports a skip parameter which you can pass on the command
line, "-Dmaven.pmd.skip=true" and
- "-Dmaven.cpd.skip=true" respectively.
+ Yes, each report supports a skip parameter which you can pass on the command
line, <<<-Dmaven.pmd.skip=true>>> and
+ <<<-Dmaven.cpd.skip=true>>> respectively.
* I want to generate one of the reports but not the other. How can I
permanently skip PMD or CPD?
- Use the \<reportSets\> feature within your POM. Below is the default
configuration for the plugin. To disable
- one of the reports, just add the \<reportSets\> below to your POM and remove
the report you don't want to generate.
+ Use the <<<\<reportSets\>>>> feature within your POM. Below is the default
configuration for the plugin. To disable
+ one of the reports, just add the <<<\<reportSets\>>>> below to your POM and
remove the report you don't want to generate.
+--------------------+
<reporting>
Copied: maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt (from
r419305, maven/plugins/trunk/maven-pmd-plugin/src/site/apt/overview.apt)
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt?p2=maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt&p1=maven/plugins/trunk/maven-pmd-plugin/src/site/apt/overview.apt&r1=419305&r2=419318&rev=419318&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/site/apt/overview.apt (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt Wed Jul 5
12:16:38 2006
@@ -7,8 +7,8 @@
Overview
The {{{http://pmd.sourceforge.net/}PMD}} plugin allows you to automatically
run the PMD code analysis tool
- on your project's source code and generate a site report with its results.
It supports the standard functions
- provided by the PMD tool including the Copy/Paste Detector or CPD.
+ on your project's source code and generate a site report with its results.
It also supports the separate
+ Copy/Paste Detector tool (or CPD) distributed with PMD.
The plugin accepts configuration parameters that will be used to customize
the execution of the PMD tool.
@@ -17,25 +17,25 @@
The PMD plugin has 4 goals:
- * {{{index.html}pmd:pmd}} creates a PMD site report based on the rulesets
and configuration set in the plugin. It can also
- generate a pmd output file aside from the site report in any of the
following formats: xml, csv or txt.
+ * {{{pmd-mojo.html}pmd:pmd}} creates a PMD site report based on the rulesets
and configuration set in the plugin.
+ It can also generate a pmd output file aside from the site report in any
of the following formats: xml, csv or txt.
- * {{{index.html}pmd:cpd}} generates a report for PMD's Copy/Paste Detector
(CPD) tool. Same as with the pmd:pmd goal, it can
- also generate a cpd output file in any of these formats: xml, csv or txt.
+ * {{{cpd-mojo.html}pmd:cpd}} generates a report for PMD's Copy/Paste
Detector (CPD) tool. It also can
+ generate a cpd results file in any of these formats: xml, csv or txt.
- * {{{index.html}pmd:check}} verifies that the PMD report is empty and fail
the build if it is not. This goal is executed by
- default when pmd:pmd is executed.
+ * {{{check-mojo.html}pmd:check}} verifies that the PMD report is empty and
fail the build if it is not. This goal is executed by
+ default when <<<pmd:pmd>>> is executed.
- * {{{index.html}pmd:cpd-check}} verifies that the CPD report is empty and
fail the build if it is not. This goal is also
- executed by default when pmd:cpd is executed.
+ * {{{cpd-check-mojo.html}pmd:cpd-check}} verifies that the CPD report is
empty and fail the build if it is not. This goal is also
+ executed by default when <<<pmd:cpd>>>> is executed.
* Usage
- Some basic instructions for configuring and using the mojos of the
<<<maven-pmd-plugin>>> can be found in
+ Some basic instructions for configuring and using the goals of the
<<<maven-pmd-plugin>>> can be found in
the {{{usage.html}Usage guide}}.
* Examples
- Sample use-cases for the plugin are available under the Examples menu.
+ More advanced usecases for the plugin are available under the Examples menu.
Modified: maven/plugins/trunk/maven-pmd-plugin/src/site/apt/usage.apt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/site/apt/usage.apt?rev=419318&r1=419317&r2=419318&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/site/apt/usage.apt (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/site/apt/usage.apt Wed Jul 5
12:16:38 2006
@@ -40,9 +40,36 @@
+-----+
+Configuration
+ The PMD and CPD reports share the same configuration. For example, the
following tells Maven to run the PMD
+ and CPD report as part of the site report generation.
+ The reports will link directly to the cross-referenced source if you enable
this with the linkXRef parameter.
+ See the {{{http://maven.apache.org/plugins/maven-jxr-plugin/}JXR}} plugin
for more details.
+ If your source uses a non-default encoding, you can use the sourceEncoding
parameter to tell Maven which
+ encoding to use when reading the java source.
+ You can configure the minimum code size which trips the CPD. The default of
100 tokens corresponds
+ to approxiamately 5-10 lines of code.
-
\ No newline at end of file
+ Since PMD parses the Java source, it needs to know which Java version to
use. The default is 1.4.
+ The following is a possible configuration:
+
++-----+
+<reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <linkXref>true</linkXref>
+ <sourceEncoding>utf-8</sourceEncoding>
+ <minimumTokens>100</minimumTokens>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+ </plugins>
+</reporting>
++-----+
Modified: maven/plugins/trunk/maven-pmd-plugin/src/site/site.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/site/site.xml?rev=419318&r1=419317&r2=419318&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/site/site.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/site/site.xml Wed Jul 5 12:16:38
2006
@@ -15,13 +15,12 @@
</links>
<menu name="Overview">
- <item name="Overview" href="overview.html"/>
+ <item name="Overview" href="index.html"/>
<item name="Usage" href="usage.html"/>
<item name="FAQ" href="faq.html"/>
</menu>
<menu name="Examples">
- <item name="Generating PMD and CPD Reports"
href="examples/generatingPmdAndCpd.html"/>
<item name="Using Rule Sets" href="examples/usingRuleSets.html"/>
<item name="Violation Checking" href="examples/violationChecking.html"/>
</menu>