Index: applications/editors/josm/plugins/build-common.xml
===================================================================
--- applications/editors/josm/plugins/build-common.xml	(revision 30561)
+++ applications/editors/josm/plugins/build-common.xml	(revision 30562)
@@ -97,26 +97,26 @@
         <antcall target="add-manifest-attribute">
             <param name="manifest.attribute" value="Plugin-Link"/>
-            <param name="propery.name" value="plugin.link"/>
-            <param name="propery.value" value="${plugin.link}"/>
+            <param name="property.name" value="plugin.link"/>
+            <param name="property.value" value="${plugin.link}"/>
         </antcall>
         <antcall target="add-manifest-attribute">
             <param name="manifest.attribute" value="Plugin-Icon"/>
-            <param name="propery.name" value="plugin.icon"/>
-            <param name="propery.value" value="${plugin.icon}"/>
+            <param name="property.name" value="plugin.icon"/>
+            <param name="property.value" value="${plugin.icon}"/>
         </antcall>
         <antcall target="add-manifest-attribute">
             <param name="manifest.attribute" value="Plugin-Early"/>
-            <param name="propery.name" value="plugin.early"/>
-            <param name="propery.value" value="${plugin.early}"/>
+            <param name="property.name" value="plugin.early"/>
+            <param name="property.value" value="${plugin.early}"/>
         </antcall>
         <antcall target="add-manifest-attribute">
             <param name="manifest.attribute" value="Plugin-Requires"/>
-            <param name="propery.name" value="plugin.requires"/>
-            <param name="propery.value" value="${plugin.requires}"/>
+            <param name="property.name" value="plugin.requires"/>
+            <param name="property.value" value="${plugin.requires}"/>
         </antcall>
         <antcall target="add-manifest-attribute">
             <param name="manifest.attribute" value="Plugin-Stage"/>
-            <param name="propery.name" value="plugin.stage"/>
-            <param name="propery.value" value="${plugin.stage}"/>
+            <param name="property.name" value="plugin.stage"/>
+            <param name="property.value" value="${plugin.stage}"/>
         </antcall>
         <antcall target="additional-manifest" />
@@ -130,7 +130,7 @@
     	<!-- to be overidden by plugins that need to perform additional tasks on resulting jar -->
     </target>
-    <target name="add-manifest-attribute" depends="check-manifest-attribute" if="have-${propery.name}">
+    <target name="add-manifest-attribute" depends="check-manifest-attribute" if="have-${property.name}">
         <manifest file="MANIFEST" mode="update">
-            <attribute name="${manifest.attribute}" value="${propery.value}" />
+            <attribute name="${manifest.attribute}" value="${property.value}" />
         </manifest>
     </target>
@@ -139,12 +139,12 @@
     </target>
     <target name="check-manifest-attribute">
-        <condition property="have-${propery.name}">
+        <condition property="have-${property.name}">
             <and>
-                <isset property="${propery.name}"/>
+                <isset property="${property.name}"/>
                 <not>
-                    <equals arg1="${propery.value}" arg2=""/>
+                    <equals arg1="${property.value}" arg2=""/>
                 </not>
                 <not>
-                    <equals arg1="${propery.value}" arg2="..."/>
+                    <equals arg1="${property.value}" arg2="..."/>
                 </not>
             </and>
@@ -200,5 +200,5 @@
            </not>
        </condition>
-   </target>
+    </target>
     <!--
       ** Initializes the REVISION.XML file from git (w/o svn) information.
@@ -369,10 +369,12 @@
         <pathelement path="${groovy.jar}"/>
     </path>
+    <condition property="plugin.requires.jars.set">
+        <isreference refid="plugin.requires.jars"/>
+    </condition>
     <macrodef name="init-test-preferences">
-        <attribute name="testfamily"/>
         <sequential>
-            <copy file="${plugin.test.dir}/config/preferences.template.xml" tofile="${plugin.test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
-            <replace file="${plugin.test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
-            <replace file="${plugin.test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
+            <copy file="${plugin.test.dir}/config/preferences.template.xml" tofile="${plugin.test.dir}/config/unit-josm.home/preferences.xml"/>
+            <replace file="${plugin.test.dir}/config/unit-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
+            <replace file="${plugin.test.dir}/config/unit-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
         </sequential>
     </macrodef>
@@ -381,5 +383,5 @@
         <mkdir dir="${plugin.test.dir}/build/unit"/>
         <mkdir dir="${plugin.test.dir}/report"/>
-        <init-test-preferences testfamily="unit"/>
+        <init-test-preferences/>
     </target>
     <target name="test-clean">
@@ -391,12 +393,12 @@
     </target>
     <macrodef name="call-groovyc">
-        <attribute name="testfamily"/>
         <element name="cp-elements"/>
         <sequential>
-            <groovyc srcdir="${plugin.test.dir}/@{testfamily}" destdir="${plugin.test.dir}/build/@{testfamily}" encoding="UTF-8">
+            <groovyc srcdir="${plugin.test.dir}/unit" destdir="${plugin.test.dir}/build/unit" encoding="UTF-8">
                 <classpath>
                     <cp-elements/>
+                    <path refid="test.classpath"/>
                 </classpath>
-                <javac target="1.7" source="1.7" debug="on">
+                <javac target="1.7" source="1.7" debug="on" encoding="UTF-8">
                     <compilerarg value="-Xlint:all"/>
                     <compilerarg value="-Xlint:-serial"/>
@@ -405,32 +407,41 @@
         </sequential>
     </macrodef>
+    <target name="call-groovyc-extended" if="plugin.requires.jars.set">
+        <call-groovyc>
+            <cp-elements>
+                <fileset refid="plugin.requires.jars"/>
+            </cp-elements>
+        </call-groovyc>
+    </target>
+    <target name="call-groovyc-base" unless="plugin.requires.jars.set">
+        <call-groovyc>
+            <cp-elements/>
+        </call-groovyc>
+    </target>
     <target name="test-compile" depends="test-init,dist">
         <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${groovy.jar}"/>
-        <call-groovyc testfamily="unit">
-            <cp-elements>
-                <path refid="test.classpath"/>
-            </cp-elements>
-        </call-groovyc>
+        <antcall target="call-groovyc-base"/>
+        <antcall target="call-groovyc-extended"/>
     </target>
     <macrodef name="call-junit">
-        <attribute name="testfamily"/>
+        <element name="cp-elements"/>
         <sequential>
-            <echo message="Running @{testfamily} tests with JUnit"/>
+            <echo message="Running unit tests with JUnit"/>
             <jacoco:coverage destfile="${plugin.test.dir}/jacoco.exec">
                 <junit printsummary="yes" fork="true" forkmode="once" dir="${basedir}">
-                    <sysproperty key="josm.home" value="${plugin.test.dir}/config/@{testfamily}-josm.home"/>
+                    <jvmarg value="-Dfile.encoding=UTF-8"/>
+                    <sysproperty key="josm.home" value="${plugin.test.dir}/config/unit-josm.home"/>
                     <sysproperty key="josm.test.data" value="${plugin.test.dir}/data"/>
                     <sysproperty key="java.awt.headless" value="true"/>
                     <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
                     <classpath>
+                        <cp-elements/>
                         <path refid="test.classpath"/>
                         <pathelement path="${plugin.test.dir}/build/unit"/>
-                        <pathelement path="${plugin.test.dir}/build/@{testfamily}"/>
-                        <pathelement path="${plugin.test.dir}/config"/>
                     </classpath>
                     <formatter type="plain"/>
                     <formatter type="xml"/>
                     <batchtest fork="yes" todir="${plugin.test.dir}/report">
-                        <fileset dir="${plugin.test.dir}/build/@{testfamily}" includes="**/*Test.class"/>
+                        <fileset dir="${plugin.test.dir}/build/unit" includes="**/*Test.class"/>
                     </batchtest>
                 </junit>
@@ -438,8 +449,21 @@
         </sequential>
     </macrodef>
-    <target name="test" depends="test-compile" 
+    <target name="call-junit-extended" if="plugin.requires.jars.set">
+        <call-junit>
+            <cp-elements>
+                <fileset refid="plugin.requires.jars"/>
+            </cp-elements>
+        </call-junit>
+    </target>
+    <target name="call-junit-base" unless="plugin.requires.jars.set">
+        <call-junit>
+            <cp-elements/>
+        </call-junit>
+    </target>
+    <target name="test" depends="dist, test-compile" 
         description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
         <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="../00_core_tools/jacocoant.jar" />
-        <call-junit testfamily="unit"/>
+        <antcall target="call-junit-base"/>
+        <antcall target="call-junit-extended"/>
     </target>
 	
