Index: lucene/common-build.xml
===================================================================
--- lucene/common-build.xml	(revision 1071818)
+++ lucene/common-build.xml	(working copy)
@@ -664,6 +664,13 @@
     </typedef>
   </target>
 
+  <target name="lucene-uptodate" unless="lucene.uptodate">
+    <uptodate property="lucene.uptodate" 
+              targetfile="${common.dir}/build/lucene-core-${version}.jar">
+     	<srcfiles dir="${common.dir}/src/java" includes="**/*.java"/>
+    </uptodate>
+  </target>
+  
   <target name="rat-sources" depends="rat-sources-typedef"
 	  description="runs the tasks over source and test files">
     <rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
Index: lucene/contrib/contrib-build.xml
===================================================================
--- lucene/contrib/contrib-build.xml	(revision 1071818)
+++ lucene/contrib/contrib-build.xml	(working copy)
@@ -60,7 +60,11 @@
     <property name="core.compiled" value="true"/>
   </target>
   
-  <target name="init" depends="common.init,build-lucene"/>
+  <target name="jar-lucene" depends="build-lucene" unless="lucene.uptodate">
+    <ant dir="${common.dir}" target="jar-core" inheritAll="false"/>
+  </target>
+  
+  <target name="init" depends="common.init,lucene-uptodate,jar-lucene"/>
   <target name="compile-test" depends="init" if="contrib.has.tests">
     <antcall target="common.compile-test" inheritRefs="true" />
   </target>
@@ -129,12 +133,13 @@
     <attribute name="name"/>
     <attribute name="property" default="@{name}.uptodate"/>
     <attribute name="classpath.property" default="@{name}.jar"/>
+    <attribute name="source.dir" default="${common.dir}/../modules/@{name}/src/java"/>
     <!-- set jarfile only, if the target jar file has no generic name, applies to analyzers with its common and smartcn subdir -->
     <attribute name="jarfile" default="${common.dir}/../modules/@{name}/build/lucene-@{name}-${version}.jar"/>
     <sequential>
       <property name="@{classpath.property}" location="@{jarfile}"/>
       <uptodate property="@{property}" targetfile="@{jarfile}">
-      	<srcfiles dir="${common.dir}/../modules/@{name}/src/java" includes="**/*.java"/>
+      	<srcfiles dir="@{source.dir}" includes="**/*.java"/>
       </uptodate>
     </sequential>
   </macrodef>
