Author: dennisl Date: Tue Aug 29 16:17:52 2006 New Revision: 438285 URL: http://svn.apache.org/viewvc?rev=438285&view=rev Log: o Add formating. o Fix typos. o Add license.
Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.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/index.apt maven/plugins/trunk/maven-pmd-plugin/src/site/apt/usage.apt 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=438285&r1=438284&r2=438285&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 Tue Aug 29 16:17:52 2006 @@ -82,8 +82,8 @@ protected String format = "xml"; /** - * Link the violation line numbers to the source xref. Defaults to true and will link - * automatically if jxr plugin is being used. + * Link the violation line numbers to the source xref. Links will be created + * automatically if the jxr plugin is being used. * * @parameter expression="${linkXRef}" default-value="true" */ Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java?rev=438285&r1=438284&r2=438285&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java Tue Aug 29 16:17:52 2006 @@ -64,7 +64,7 @@ { /** - * The target JDK to analyse based on. Should match the target directory for the compiler plugin. Valid values are + * The target JDK to analyse based on. Should match the target used in the compiler plugin. Valid values are * currently <code>1.3</code>, <code>1.4</code>, <code>1.5</code>. * * @parameter expression="${targetJdk}" 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=438285&r1=438284&r2=438285&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 Tue Aug 29 16:17:52 2006 @@ -6,6 +6,22 @@ 30 June 2006 ------ +~~ Copyright 2006 The Apache Software Foundation. +~~ +~~ Licensed under the Apache License, Version 2.0 (the "License"); +~~ you may not use this file except in compliance with the License. +~~ You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, software +~~ distributed under the License is distributed on an "AS IS" BASIS, +~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~~ See the License for the specific language governing permissions and +~~ limitations under the License. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html Using Rule Sets @@ -14,28 +30,28 @@ rule sets, you can configure the plugin as shown below: +-----+ -<reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <configuration> - <rulesets> - <ruleset>/rules/braces.xml</ruleset> - <ruleset>/rules/naming.xml</ruleset> - <ruleset>d:\rulesets\strings.xml</ruleset> - <ruleset>http://localhost/design.xml</ruleset> - </rulesets> - </configuration> - </plugin> - </plugins> -</reporting> +<project> + ... + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <rulesets> + <ruleset>/rules/braces.xml</ruleset> + <ruleset>/rules/naming.xml</ruleset> + <ruleset>d:\rulesets\strings.xml</ruleset> + <ruleset>http://localhost/design.xml</ruleset> + </rulesets> + </configuration> + </plugin> + </plugins> + </reporting> + ... +</project> +-----+ The rulesets may reside in the classpath, filesystem or at a URL. For rule sets that are already bundled with the PMD tool, you do not need to specificy the absolute path of the file. It will be resolved by the plugin. But if the rule set is a custom rule set, you need to specify its absolute path. - - - - 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=438285&r1=438284&r2=438285&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 Tue Aug 29 16:17:52 2006 @@ -4,6 +4,22 @@ 23 June 2006 ------ +~~ Copyright 2006 The Apache Software Foundation. +~~ +~~ Licensed under the Apache License, Version 2.0 (the "License"); +~~ you may not use this file except in compliance with the License. +~~ You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, software +~~ distributed under the License is distributed on an "AS IS" BASIS, +~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~~ See the License for the specific language governing permissions and +~~ limitations under the License. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html Violation Checking @@ -14,21 +30,24 @@ phase. +-----+ -<build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>check</goal> - <goal>cpd-check</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> -</build> +<project> + ... + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>check</goal> + <goal>cpd-check</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + ... +</project> +-----+ - 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=438285&r1=438284&r2=438285&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 Tue Aug 29 16:17:52 2006 @@ -6,6 +6,23 @@ 30 June 2006 ------ +~~ Copyright 2006 The Apache Software Foundation. +~~ +~~ Licensed under the Apache License, Version 2.0 (the "License"); +~~ you may not use this file except in compliance with the License. +~~ You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, software +~~ distributed under the License is distributed on an "AS IS" BASIS, +~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~~ See the License for the specific language governing permissions and +~~ limitations under the License. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + FAQs * The PMD report takes a long time to generate. Is there any way to skip the PMD or CPD reports temporarily? @@ -19,19 +36,23 @@ one of the reports, just add the <<<\<reportSets\>>>> below to your POM and remove the report you don't want to generate. +--------------------+ -<reporting> - <plugins> - <plugin> - <artifactId>maven-pmd-plugin</artifactId> - <reportSets> - <reportSet> - <reports> - <report>pmd</report> - <report>cpd</report> - </reports> - </reportSet> - </reportSets> - </plugin> - </plugins -</reporting> +<project> + ... + <reporting> + <plugins> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <reportSets> + <reportSet> + <reports> + <report>pmd</report> + <report>cpd</report> + </reports> + </reportSet> + </reportSets> + </plugin> + </plugins + </reporting> + ... +</project> +--------------------+ Modified: maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt?rev=438285&r1=438284&r2=438285&view=diff ============================================================================== --- maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt (original) +++ maven/plugins/trunk/maven-pmd-plugin/src/site/apt/index.apt Tue Aug 29 16:17:52 2006 @@ -1,10 +1,27 @@ ------ - Overview + Introduction ------ 06 January 2006 ------ -Overview +~~ Copyright 2006 The Apache Software Foundation. +~~ +~~ Licensed under the Apache License, Version 2.0 (the "License"); +~~ you may not use this file except in compliance with the License. +~~ You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, software +~~ distributed under the License is distributed on an "AS IS" BASIS, +~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~~ See the License for the specific language governing permissions and +~~ limitations under the License. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + +Maven 2 PMD Plugin 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 also supports the separate @@ -15,12 +32,12 @@ * Goals Overview - The PMD plugin has 4 goals: + This plugin has 4 goals: * {{{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. - * {{{cpd-mojo.html}pmd:cpd}} generates a report for PMD's Copy/Paste Detector (CPD) tool. It also can + * {{{cpd-mojo.html}pmd:cpd}} generates a report for PMD's Copy/Paste Detector (CPD) tool. It can also generate a cpd results file in any of these formats: xml, csv or txt. * {{{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 @@ -31,11 +48,8 @@ * Usage - Some basic instructions for configuring and using the goals of the <<<maven-pmd-plugin>>> can be found in - the {{{usage.html}Usage guide}}. + Instructions on how to use the PMD Plugin can be found {{{usage.html}here}}. * Examples 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=438285&r1=438284&r2=438285&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 Tue Aug 29 16:17:52 2006 @@ -6,37 +6,61 @@ 23 June 2006 ------ +~~ Copyright 2006 The Apache Software Foundation. +~~ +~~ Licensed under the Apache License, Version 2.0 (the "License"); +~~ you may not use this file except in compliance with the License. +~~ You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, software +~~ distributed under the License is distributed on an "AS IS" BASIS, +~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~~ See the License for the specific language governing permissions and +~~ limitations under the License. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html Usage The PMD plugin generates PMD and CPD reports using the PMD code analysis tool. - To include a report with default rule sets and configuration in your project site, set the following in the \<reporting\> - section of your pom: + To include a report with default rule sets and configuration in your project site, set the following in the + <<<\<reporting\>>>> section of your pom: +-----+ -<reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - </plugin> - </plugins> -</reporting> +<project> + ... + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + </plugin> + </plugins> + </reporting> + ... +</project> +-----+ - You can also explicitly execute the PMD plugin and generate the same report by setting the plugin in the \<build\> - section of your pom as shown below: + You can also explicitly execute the PMD plugin and generate the same report by setting the plugin in the + <<<\<build\>>>> section of your pom as shown below: +-----+ -<build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-pmd-plugin</artifactId> - </plugin> - </plugins> -</build> +<project> + ... + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + </plugin> + </plugins> + </build> + ... +</project> +-----+ @@ -45,10 +69,10 @@ 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. + 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 + 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. Note also the ability to exclude source which you want to ignore. @@ -59,22 +83,26 @@ 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> - <excludes> - <exclude>**/*Bean.java</exclude> - <exclude>**/generated/*.java</exclude> - </excludes> - </configuration> - </plugin> - </plugins> -</reporting> +<project> + ... + <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> + <excludes> + <exclude>**/*Bean.java</exclude> + <exclude>**/generated/*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </reporting> + ... +</project> +-----+