Index: lucene/common-build.xml
===================================================================
--- lucene/common-build.xml	(revision 1326375)
+++ lucene/common-build.xml	(working copy)
@@ -252,15 +252,7 @@
   </target>
 
   <target name="init" depends="resolve">
-    <!-- JUnit4 taskdef. -->
-    <taskdef resource="com/carrotsearch/junit4/antlib.xml">
-      <classpath>
-         <fileset dir="${common.dir}/test-framework/lib">
-            <include name="junit4-ant-*.jar" />
-            <include name="junit-*.jar" />
-         </fileset>
-      </classpath>
-    </taskdef>    
+    <!-- currently empty -->
   </target>
 
   <target name="resolve" depends="ivy-availability-check,ivy-fail">
@@ -928,7 +920,19 @@
       </echo>
   </target>
 
-  <target name="test" depends="compile-test,validate" description="Runs unit tests">
+  <target name="install-junit4-taskdef">
+    <!-- JUnit4 taskdef. -->
+    <taskdef resource="com/carrotsearch/junit4/antlib.xml">
+      <classpath>
+         <fileset dir="${common.dir}/test-framework/lib">
+            <include name="junit4-ant-*.jar" />
+            <include name="junit-*.jar" />
+         </fileset>
+      </classpath>
+    </taskdef>
+  </target>
+
+  <target name="test" depends="compile-test,install-junit4-taskdef,validate" description="Runs unit tests">
     <mkdir dir="${junit.output.dir}"/>
     <test-macro threadNum="${tests.threadspercpu}" />
   </target>
Index: lucene/build.xml
===================================================================
--- lucene/build.xml	(revision 1326375)
+++ lucene/build.xml	(working copy)
@@ -106,7 +106,7 @@
   Add dependency after 4.0: depends="compile-backwards, backwards-test-warning"
   and uncomment inside of this target.
   -->
-  <target name="test-backwards">
+  <target name="test-backwards" depends="install-junit4-taskdef">
     <!--
     <mkdir dir="${build.dir.backwards}/test"/>
     <backwards-test-macro/>
