diff --git a/pmd/pom.xml b/pmd/pom.xml
index 7ce6d90485..4f898e1eed 100644
--- a/pmd/pom.xml
+++ b/pmd/pom.xml
@@ -274,6 +274,7 @@
1.5
+
org.apache.maven.plugins
maven-antrun-plugin
@@ -301,37 +302,6 @@
run
-
- generate-ruleset-as-xdocs
- pre-site
-
-
- PMD specific tasks: generating xdocs from rulesets
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- run
-
-
move-index-and-delete-generated-xdocs
site
@@ -388,12 +358,16 @@
+
com.atlassian.maven.plugins
maven-clover2-plugin
2.5.1
- 1.5
+ 1.6
tools/config/clover2.license
@@ -436,7 +410,19 @@
-
+
+ pmd
+ pmd-build
+ 0.4
+
+
+ pre-site
+
+ pmd-pre-site
+
+
+
+
diff --git a/pmd/tools/pom.xml b/pmd/tools/pom.xml
index c630c2b11c..3286a821fa 100644
--- a/pmd/tools/pom.xml
+++ b/pmd/tools/pom.xml
@@ -5,6 +5,7 @@
pmd-build
PMD
0.4
+ maven-plugin
4.4
test
+
+ org.apache.maven
+ maven-plugin-api
+ 2.0
+ provided
+
diff --git a/pmd/tools/src/net/sourceforge/pmd/maven/PmdPreSite.java b/pmd/tools/src/net/sourceforge/pmd/maven/PmdPreSite.java
new file mode 100644
index 0000000000..110d177737
--- /dev/null
+++ b/pmd/tools/src/net/sourceforge/pmd/maven/PmdPreSite.java
@@ -0,0 +1,64 @@
+package net.sourceforge.pmd.maven;
+
+import net.sourceforge.pmd.build.PmdBuildException;
+import net.sourceforge.pmd.build.PmdBuildTools;
+import net.sourceforge.pmd.build.RuleSetToDocs;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Says "Hi" to the user.
+ * @goal pmd-pre-site
+ */
+public class PmdPreSite extends AbstractMojo
+{
+ /**
+ * Path to the existing site descriptor
+ *
+ * @parameter expression="${pmd.siteXml}" default-value="src/site/site.pre.xml"
+ */
+ private String siteXml;
+
+ /**
+ * Path to the existing site descriptor
+ *
+ * @parameter expression="${pmd.siteXml.target}" default-value="src/site/site.xml"
+ */
+ private String siteXmlTarget;
+
+ /**
+ * Path to the existing site descriptor
+ *
+ * @parameter expression="${pmd.siteTarget}" default-value="${project.build.directory}/generated-xdocs/rules"
+ */
+ private String target;
+
+ /**
+ * Path to the existing site descriptor
+ *
+ * @parameter expression="${pmd.rulesets}" default-value="src/main/resources/rulesets/
+ */
+ private String rulesetsDirectory;
+
+ public void execute() throws MojoExecutionException {
+ getLog().info("PMD: site generation preparation");
+ getLog().debug("- target:" + target);
+ getLog().debug("- siteXml:" + siteXml);
+ getLog().debug("- rulesets:" + rulesetsDirectory);
+ getLog().debug(" -siteXmlTarget" + siteXmlTarget);
+ PmdBuildTools tool = new RuleSetToDocs();
+ tool.setTargetDirectory(target);
+ tool.setSiteXml(siteXml);
+ tool.setRulesDirectory(rulesetsDirectory);
+ tool.setSiteXmlTarget(siteXmlTarget);
+
+ try {
+ tool.convertRulesets();
+ tool.preSiteGeneration();
+ }
+ catch ( PmdBuildException e) {
+ throw new MojoExecutionException(e.getMessage());
+ }
+ }
+}
\ No newline at end of file