--- a/build.xml
+++ b/build.xml
@@ -1,82 +1,78 @@
-<project name="PMDPlugin" default="dist" basedir=".">
+<project name="PMDPlugin" default="jar" basedir=".">
 
-    <!-- user defined build properties, these override any properties set below -->
-    <property file="build.properties"/>
-    <property file="../build.properties"/>
+	<property file="build.properties"></property>
+	<property name="config" value="."/>
+	<property name="src" value="src/"/>
+	<property name="lib" value="lib"/>
+	<property name="build" value="build"/>
+	<property name="pmdjar" value="pmd-1.2.1.jar"/>
+	<property name="pluginversion" value="2.2"/>
+	<property name="jedit.install.dir" value="../.."/>
+	<property name="jedit.jars.dir" value="${jedit.install.dir}\jars"/>
+	<property name="install.dir"  value=".."/>
 
-    <!-- properties specific to this build file -->
-    <property name="build" location="build"/>
-    <property name="src" location="src"/>
-    <property name="lib" location="lib"/>
 
-    <!-- default location of jEdit installation containing jedit.jar -->
-    <property name="jedit.install.dir" location="../.."/>
+	<path id="project.class.path">
+		<pathelement location="${jedit.install.dir}/jedit.jar"/>
+		<pathelement location="${jedit.jars.dir}/ErrorList.jar"/>
+		<pathelement location="${lib}/${pmdjar}"/>
+		<pathelement location="${lib}/jaxen-core-1.0-fcs.jar"/>
+		<pathelement location="${lib}/pmd-swingui-0.1.jar"/>
+		<pathelement location="${lib}/saxpath-1.0-fcs.jar"/>
+		<pathelement location="${build}"/>
+	</path>
 
-    <!-- default location of user folder containing plugin jars -->
-    <property name="install.dir"  location="${user.home}/.jedit/jars"/>
-    <property name="jedit.plugins.dir" location="${install.dir}"/>
-
-    <!-- set up the classpath for the build -->
-    <path id="project.class.path">
-        <pathelement location="${jedit.install.dir}/jedit.jar"/>
-        <pathelement location="${jedit.plugins.dir}/ErrorList.jar"/>
-        <pathelement location="${jedit.plugins.dir}/CommonControls.jar"/>
-        <pathelement location="${jedit.plugins.dir}/kappalayout.jar"/>
-        <pathelement location="${build}"/>
-        <fileset casesensitive="false" id="pmd.libs" dir="${lib}">
-            <include name="*.jar"/>
-        </fileset>
-    </path>
-
-    <!-- might be able to auto-reload the plugin -->
-    <condition property="can.reload.plugins">
-        <and>
-            <available classname="org.gjt.sp.jedit.jEdit"/>
-            <available classname="ReloadPluginTask"/>
-        </and>
-    </condition>
-
-    <!-- Target: clean - delete the build directory contents -->
-    <target name="clean">
-        <delete dir="${build}"/>
+    <target name="delete">
+        <delete file="${install.dir}/${ant.project.name}.jar"/>
+		<delete dir="${build}"/>
         <mkdir dir="${build}"/>
     </target>
 
-    <!-- Target: compile -->
-    <target name="compile">
-        <mkdir dir="${build}"/>
-        <javac
-            srcdir="${src}"
-            destdir="${build}"
-            source="1.5"
-            target="1.5"
-            debug="on"
-            deprecation="on">
-            <classpath refid="project.class.path"/>
-        </javac>
+	<target name="compile">
+		<mkdir dir="${build}"/>
+		<javac
+			srcdir="${src}"
+			destdir="${build}"
+			debug="on"
+			deprecation="on">
+			<classpath refid="project.class.path"/>
+		</javac>
+	</target>
+
+    <target name="jar" depends="compile">
+		<jar jarfile="${install.dir}/${ant.project.name}.jar">
+			<fileset dir="${build}"/>
+			<fileset dir="${config}">
+				<include name="*.props"/>
+				<include name="*.xml"/>
+				<include name="*.html"/>
+			</fileset>
+		</jar>
     </target>
 
-    <!-- Target: jar - create the plugin -->
-    <target name="dist" depends="compile">
-        <jar jarfile="${install.dir}/${ant.project.name}.jar">
-            <fileset dir="${build}"/>
-            <fileset dir="${basedir}">
-                <include name="*.props"/>
-                <include name="*.xml"/>
-                <include name="*.html"/>
-                <include name="doc/*"/>
-            </fileset>
-        </jar>
-        <copy todir="${install.dir}">
-            <fileset refid="pmd.libs" />
-        </copy>
-        <antcall target="reload"/>
+
+	<target name="dist" depends="clean">
+        <antcall target="jar"/>
+		<copy todir="${install.dir}">
+			<fileset casesensitive="false" dir="${lib}" includes="*.jar"></fileset>
+		</copy>
+	</target>
+
+    <target name="release">
+        <antcall target="clean"/>
+        <antcall target="jar"/>
+        <mkdir dir="tmp/jars"/>
+        <copy file="${install.dir}/${ant.project.name}.jar" todir="tmp/jars"/>
+        <copy file="${install.dir}/${pmdjar}" todir="tmp/jars"/>
+        <copy file="${lib}/jaxen-core-1.0-fcs.jar" todir="tmp/jars"/>
+        <copy file="${lib}/saxpath-1.0-fcs.jar" todir="tmp/jars"/>
+        <copy file="${lib}/pmd-swingui-0.1.jar" todir="tmp/jars"/>
+        <zip zipfile="pmd-jedit-bin-${pluginversion}.zip" basedir="tmp"/>
+        <move file="pmd-jedit-bin-${pluginversion}.zip" todir="${install.dir}"/>
+        <delete dir="tmp"/>
     </target>
 
-    <target name="reload" if="can.reload.plugins">
-        <echo>Reloading ${install.dir}/${ant.project.name}.jar</echo>
-        <taskdef name="reloadPlugin" classname="ReloadPluginTask"/>
-        <reloadPlugin jarfile="${install.dir}/${ant.project.name}.jar"/>
-    </target>
+	<target name="clean" depends="delete,compile">
+	</target>
 
 </project>