Adding ant task to the pom.xml. Those task replace the documentation generation that used to do maven 1.

Also move from etc the checkstyle-config.xml (seems cleaner to me to have it in tool directory).

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@6030 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse
2008-04-17 18:06:12 +00:00
parent 3b93617f41
commit 3990dfaaaa
2 changed files with 128 additions and 2 deletions

View File

@ -250,6 +250,72 @@
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<inherited>true</inherited>
<executions>
<execution>
<id>generate-ruleset-as-xdocs</id>
<phase>pre-site</phase>
<configuration>
<tasks>
<echo>PMD specific tasks: generating xdocs</echo>
<ant antfile="tool/ant/generate-pmd-xdoc.xml">
<property name="target" value="xdocs/rules"/>
<property name="lib" value="${basedir}/tool/lib"/>
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>move-index-and-delete-generated-xdocs</id>
<phase>post-site</phase>
<configuration>
<tasks>
<echo>PMD specific tasks: cleaning generated xdocs</echo>
<move file="${project.build.directory}/site/rules/index.html"
tofile="${project.build.directory}/site/index.html"/>
<delete>
<fileset dir="xdocs/rules"
includes="**/*.xml"/>
<fileset dir="xdocs"
includes="mergedrules.xml"/>
</delete>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>pmd-clean</id>
<phase>clean</phase>
<configuration>
<tasks>
<echo>PMD specific tasks: cleaning generated xdocs</echo>
<delete>
<fileset dir="xdocs/rules"
includes="**/*.xml"/>
</delete>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
@ -299,8 +365,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
@ -318,7 +384,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>etc/checkstyle-config.xml</configLocation>
<configLocation>tool/config/checkstyle-config.xml</configLocation>
</configuration>
</plugin>
</plugins>

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<property name="severity" value="warning"/>
<!-- JDocPackage
TODO: I don't know if this one is really relevant
<module name="PackageHtml">
<property name="severity" value="error"/>
</module>
-->
<module name="TreeWalker">
<!-- RegexpHeader -->
<!--
Assert if header is :
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-->
<module name="RegexpHeader">
<property
name="header"
value="^\/\*\*[ ]*$\n^[ ]+\*[ ]+BSD-style license; for more info see http:\/\/pmd.sourceforge.net/license.html[ ]*\n[ ]+\*\/[ ]*$"/>
</module>
<!-- JDocHtmlValid, JDocHeader -->
<module name="JavadocStyle">
<property name="checkFirstSentence" value="false"/>
<property name="checkEmptyJavadoc" value="true"/>
<property name="severity" value="error"/>
</module>
<!-- JDocHeader -->
<module name="JavadocType">
<property name="versionFormat" value="\S"/>
<property name="authorFormat" value="\S"/>
<property name="severity" value="error"/>
</module>
<!-- JDocMethod-1, JDocMethod-3, JDocException-1 -->
<module name="JavadocMethod">
<property name="severity" value="error"/>
<property name="scope" value="package"/>
</module>
<!-- JDocMethod-1 -->
<module name="JavadocVariable">
<property name="severity" value="error"/>
<property name="scope" value="package"/>
</module>
<!-- AvoidStarImport -->
<module name="AvoidStarImport">
<property name="severity" value="error"/>
</module>
</module>
</module>