Index: plugins/build-common.xml
===================================================================
--- plugins/build-common.xml	(revision 35641)
+++ plugins/build-common.xml	(working copy)
@@ -586,34 +586,36 @@
         description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
         <sequential>
             <echo message="Running unit tests with JUnit"/>
-            <jacoco:coverage destfile="${plugin.test.dir}/jacoco.exec" enabled="${coverageByDefault}">
-                <junit printsummary="yes" fork="true" forkmode="once" dir="${basedir}">
-                    <jvmarg value="-Dfile.encoding=UTF-8"/>
-                    <jvmarg value="-javaagent:${jmockit.jar}"/>
-                    <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" />
-                    <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" />
-                    <jvmarg value="--add-opens" if:set="isJava9" />
-                    <jvmarg value="java.base/java.lang.reflect=ALL-UNNAMED" if:set="isJava9" />
-                    <jvmarg value="--add-opens" if:set="isJava9" />
-                    <jvmarg value="java.desktop/javax.imageio.spi=ALL-UNNAMED" if:set="isJava9" />
-                    <jvmarg value="--add-exports" if:set="isJava9" />
-                    <jvmarg value="java.desktop/com.sun.imageio.spi=ALL-UNNAMED" if:set="isJava9" />
-                    <sysproperty key="josm.home" value="../00_core_test_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>
-                        <fileset refid="plugin.requires.jars"/>
-                        <path refid="test.classpath"/>
-                        <pathelement path="${plugin.test.dir}/build/unit"/>
-                    </classpath>
-                    <formatter type="plain"/>
-                    <formatter type="xml"/>
-                    <batchtest fork="yes" todir="${plugin.test.dir}/report">
-                        <fileset dir="${plugin.test.dir}/build/unit" includes="**/*Test.class"/>
-                    </batchtest>
-                </junit>
-            </jacoco:coverage>
+            <jacoco:agent destfile="${plugin.test.dir}/jacoco.exec" enabled="${coverageByDefault}" property="jacocoagent"/>
+            <junitlauncher printsummary="yes">
+                <classpath>
+                    <fileset refid="plugin.requires.jars"/>
+                    <path refid="test.classpath"/>
+                    <pathelement path="${plugin.test.dir}/build/unit"/>
+                </classpath>
+                <testclasses outputDir="${plugin.test.dir}/report">
+                    <fileset dir="${plugin.test.dir}/build/unit" includes="**/*Test.class"/>
+	                <fork>
+                        <jvmarg value="${jacocoagent}" if:set="jacocoagent" />
+                        <jvmarg value="-Dfile.encoding=UTF-8"/>
+                        <jvmarg value="-javaagent:${jmockit.jar}"/>
+                        <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" />
+                        <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" />
+                        <jvmarg value="--add-opens" if:set="isJava9" />
+                        <jvmarg value="java.base/java.lang.reflect=ALL-UNNAMED" if:set="isJava9" />
+                        <jvmarg value="--add-opens" if:set="isJava9" />
+                        <jvmarg value="java.desktop/javax.imageio.spi=ALL-UNNAMED" if:set="isJava9" />
+                        <jvmarg value="--add-exports" if:set="isJava9" />
+                        <jvmarg value="java.desktop/com.sun.imageio.spi=ALL-UNNAMED" if:set="isJava9" />
+                        <sysproperty key="josm.home" value="../00_core_test_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}"/>
+	                </fork>
+                    <listener type="legacy-plain" />
+                    <listener type="legacy-xml" />
+                </testclasses>
+            </junitlauncher>
         </sequential>
     </target>
 
