Index: pmd.xml
===================================================================
--- pmd.xml	(révision 0)
+++ pmd.xml	(révision 0)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<ruleset name="dogfood" 
+	xmlns="http://pmd.sf.net/ruleset/1.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+	xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
+	<description>JBoss Transaction Management java code rules</description>
+
+	<rule ref="rulesets/basic.xml"/>
+	<rule ref="rulesets/clone.xml"/>
+	<rule ref="rulesets/codesize.xml"/>
+	<rule ref="rulesets/design.xml"/>
+	<rule ref="rulesets/j2ee.xml"/>
+	<rule ref="rulesets/naming.xml"/>
+	<rule ref="rulesets/optimizations.xml"/>
+	<rule ref="rulesets/strictexception.xml"/>
+	<rule ref="rulesets/strings.xml"/>
+	<rule ref="rulesets/unusedcode.xml"/>
+
+</ruleset>
Index: build.xml
===================================================================
--- build.xml	(révision 26026)
+++ build.xml	(copie de travail)
@@ -215,7 +215,82 @@
 			basedir="${org.jboss.jbossts.qa.dist.buildroot}" excludes="jbossts-${buildtype}-qa-distribution.zip"/>
 
     </target>
+    
+        <target name="code_quality">
+    
+        <property name="code_qa" value="code_qa_results"/>
+	<property name="pmd_config" value="pmd.xml"/>
 
+        <delete dir="${code_qa}"/>
+        <mkdir  dir="${code_qa}"/>
+    
+        <!-- Defining a new task for Ant : PMD -->
+        <path id="pmd.classpath">
+            <pathelement location="tools/asm-3.1.jar" />
+            <pathelement location="tools/jaxen-1.1.1.jar" />
+            <pathelement location="tools/pmd-4.2.5.jar" />
+	    <pathelement location="${pmd_config}"/>
+        </path>
+        
+        <taskdef     name="pmd"
+                     classname="net.sourceforge.pmd.ant.PMDTask">
+            <classpath refid="pmd.classpath" />
+        </taskdef>
+
+        <!-- Setting up PMD -->
+        <pmd     targetjdk="1.5"
+                 shortFilenames="true"
+                 failOnRuleViolation="build.fail.on.pmd.ruleViolation"
+                 rulesetfiles="${pmd_config}">
+            <formatter     type="xml"
+                           toFile="${code_qa}/pmd.xml"
+                           linePrefix=".line" />
+            <formatter     type="html"
+                           toFile="${code_qa}/pmd.html"/>
+            <fileset dir="${basedir}/../ArjunaJTA/jta/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTA/jdbc/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTS/jts/services/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTS/jts/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTS/jtax/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTS/orbportability/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../common/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../XTS/WSTX/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../XTS/WSCF/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../XTS/WSAS/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../atsintegration/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaCore/arjuna/services/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaCore/arjuna/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaCore/tsmx/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaCore/txoj/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../antbuildsystem/classes" includes="**/*.java"/>
+        </pmd>
+
+        <!-- Setting up Cut'n'Paste Detector -->
+        <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask">
+            <classpath refid="pmd.classpath" />
+        </taskdef>
+
+        <cpd     minimumTokenCount="250"
+                 outputFile="${code_qa}/cpd.xml">
+            <fileset dir="${basedir}/../ArjunaJTA/jta/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTA/jdbc/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTS/jts/services/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTS/jts/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTS/jtax/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaJTS/orbportability/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../common/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../XTS/WSTX/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../XTS/WSCF/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../XTS/WSAS/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../atsintegration/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaCore/arjuna/services/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaCore/arjuna/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaCore/tsmx/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../ArjunaCore/txoj/classes" includes="**/*.java"/>
+            <fileset dir="${basedir}/../antbuildsystem/classes" includes="**/*.java"/>
+        </cpd>
+    </target>
+
 	<target name="help">
 <echo>Supported targets:
   jta - build tests for the standalone jta transaction engine
