<?xml version="1.0"?>

<document>
  <properties>
    <author>Tom Copeland</author>
    <title>Compiling PMD</title>
  </properties>

  <body>
  <section name="Compiling PMD">
<p>
First, you'll need to download and install <a href="http://ant.apache.org/bindownload.cgi">Ant</a> 1.6
    and <a href="http://www.junit.org/">JUnit</a> 3.8.2.  I put the junit jar file in my ANT_HOME/lib/
    directory and all was well, your mileage may vary.</p>
<p>
Now you'll need to either check out the source code or download the latest source release.
    Assuming you've got the latest source release, unzip it to a directory:
    <pre>
        [tom@hal building]$ ls -l
        total 5716
        -rw-rw-r--    1 tom      tom       5837216 Jul 17 13:09 pmd-src-4.2.3.zip
        [tom@hal building]$ unzip -q pmd-src-4.2.3.zip
        [tom@hal building]$
    </pre>
</p>
<p>
    Now cd down into the <code>pmd/bin</code> directory:
    <pre>
        [tom@hal building]$ cd pmd-4.2.3/bin/
        [tom@hal bin]$ ls -l | grep build.xml
        -rw-rw-r--    1 tom      tom          5736 Jun 19 15:36 build.xml
        [tom@hal bin]$
    </pre>
</p>
<p>
    There's our Ant build file... let's compile!
    <pre>
        [tom@hal bin]$ ant compile
        Buildfile: build.xml

        compile:
            [javac] Compiling 509 source files to /home/tom/data/pmd/pmd/build

        BUILD SUCCESSFUL
        Total time: 6 seconds
        [tom@hal bin]$
    </pre>
</p>
<p>
    Notes:
    <ul>
        <li>There's also a build.xml in the top-level directory, but it's for Maven.  Renaming it made Maven
            do odd things; anybody know how to get around that?</li>
        <li>The rules that have already been written are specified in the rulesets/ directory in the
            source distribution.  They're also in the jar file that's included with both the
            source and binary distributions.</li>
    </ul>
</p>

<p>A paucity of detail, I'm sure you'd agree.  If you think this document can be
improved, please post <a href="http://sourceforge.net/forum/forum.php?forum_id=188192">here</a> and let me know how.  Thanks!
</p>

</section>
</body>
</document>
