Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 19687)
+++ /trunk/build.xml	(revision 19688)
@@ -938,9 +938,15 @@
     </target>
 
-    <target name="pmd" depends="init" description="Run PMD on the source files">
+    <target name="pmd" depends="compile" description="Run PMD on the source files">
         <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="pmd.classpath" conf="pmd"/>
         <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
         <pmd cacheLocation="${pmd.dir}/cache" encoding="UTF-8">
             <sourceLanguage name="java" version="${java.lang.version}" />
+            <!-- PMD needs the Java runtime, the compiled classes and the dependencies to resolve types -->
+            <auxclasspath>
+                <pathelement location="${java.home}/lib/jrt-fs.jar"/>
+                <pathelement location="${build.dir}"/>
+                <path refid="compile.path"/>
+            </auxclasspath>
             <ruleset>${pmd.dir}/josm-ruleset.xml</ruleset>
             <formatter type="text" toConsole="true" />
Index: /trunk/pom.xml
===================================================================
--- /trunk/pom.xml	(revision 19687)
+++ /trunk/pom.xml	(revision 19688)
@@ -438,4 +438,8 @@
           <language>java</language>
           <targetJdk>${java.lang.version}</targetJdk>
+          <compileSourceRoots>
+            <compileSourceRoot>${src.dir}</compileSourceRoot>
+            <compileSourceRoot>${scripts.src.dir}</compileSourceRoot>
+          </compileSourceRoots>
           <rulesets>
             <ruleset>${pmd.dir}/josm-ruleset.xml</ruleset>
