Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

PMD checks added

Piotr Kosiorowskic6bb183cd72c
diff --git a/build.xml b/build.xml
index b2abb5da2..3184963fb 100644
--- a/build.xml
+++ b/build.xml
@@ -197,6 +197,45 @@
</javac>
</target>
+ <!-- ================================================================== -->
+ <!-- Run code checks (PMD) -->
+ <!-- ================================================================== -->
+ <target name="pmd" depends="compile">
+ <property name="pmd.report" location="${build.dir}/pmd-report.html" />
+ <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
+ <classpath>
+ <fileset dir="${lib.dir}">
+ <include name="pmd-ext/*.jar" />
+ <include name="xerces*.jar" />
+ </fileset>
+ </classpath>
+ </taskdef>
+ <pmd shortFilenames="true" failonerror="true" failOnRuleViolation="false"
+ encoding="${build.encoding}" failuresPropertyName="pmd.failures">
+ <ruleset>unusedcode</ruleset>
+ <!--ruleset>basic</ruleset-->
+ <!--ruleset>optimizations</ruleset-->
+ <formatter type="html" toFile="${pmd.report}" />
+ <!-- <formatter type="xml" toFile="${tempbuild}/$report_pmd.xml"/> -->
+ <fileset dir="${basedir}/src">
+ <include name="java/**/*.java"/>
+ <include name="plugin/**/*.java"/>
+ <!-- Exclude generated sources -->
+ <exclude name="**/NutchAnalysis.java" />
+ <exclude name="**/NutchAnalysisTokenManager.java" />
+ </fileset>
+ </pmd>
+ <condition property="pmd.stop" value="true">
+ <and>
+ <isset property="pmd.failures" />
+ <not>
+ <equals arg1="0" arg2="${pmd.failures}" trim="true" />
+ </not>
+ </and>
+ </condition>
+ <fail if="pmd.stop">FAILURE: PMD shows ${pmd.failures} rule violations. See ${pmd.report} for details.</fail>
+ </target>
+
<!-- ================================================================== -->
<!-- Run unit tests -->
<!-- ================================================================== -->
diff --git a/lib/pmd-ext/jakarta-oro-2.0.8.jar b/lib/pmd-ext/jakarta-oro-2.0.8.jar
new file mode 100644
index 000000000..23488d260
Binary files /dev/null and b/lib/pmd-ext/jakarta-oro-2.0.8.jar differ
diff --git a/lib/pmd-ext/jaxen-1.1-beta-7.jar b/lib/pmd-ext/jaxen-1.1-beta-7.jar
new file mode 100644
index 000000000..98ffbe384
Binary files /dev/null and b/lib/pmd-ext/jaxen-1.1-beta-7.jar differ
diff --git a/lib/pmd-ext/pmd-3.6.LICENSE.txt b/lib/pmd-ext/pmd-3.6.LICENSE.txt
new file mode 100644
index 000000000..49e91d0d1
--- /dev/null
+++ b/lib/pmd-ext/pmd-3.6.LICENSE.txt
@@ -0,0 +1,31 @@
+Copyright (c) 2003, InfoEther, LLC
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+ * The end-user documentation included with the redistribution, if
+any, must include the following acknowledgement:
+ "This product includes software developed in part by support from
+the Defense Advanced Research Project Agency (DARPA)"
+ * Neither the name of InfoEther, LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/lib/pmd-ext/pmd-3.6.jar b/lib/pmd-ext/pmd-3.6.jar
new file mode 100644
index 000000000..fef6eddc0
Binary files /dev/null and b/lib/pmd-ext/pmd-3.6.jar differ