Index: solr/common-build.xml
===================================================================
--- solr/common-build.xml	(revision 1151075)
+++ solr/common-build.xml	(working copy)
@@ -78,76 +78,109 @@
     -->
   <property name="solr.spec.version" value="4.0.0.${dateversion}" />
 
-  <!-- solr depends on the following modules/contribs -->	
-  <module-uptodate name="analysis/common" jarfile="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"
-        property="analyzers-common.uptodate" classpath.property="analyzers-common.jar"/>
-  <module-uptodate name="analysis/phonetic" jarfile="${common.dir}/../modules/analysis/build/phonetic/lucene-analyzers-phonetic-${version}.jar"
-        property="analyzers-phonetic.uptodate" classpath.property="analyzers-phonetic.jar"/>
-  <module-uptodate name="suggest" jarfile="${common.dir}/../modules/suggest/build/lucene-suggest-${version}.jar"
-        property="suggest.uptodate" classpath.property="suggest.jar"/>
-  <module-uptodate name="grouping" jarfile="${common.dir}/../modules/grouping/build/lucene-grouping-${version}.jar"
-        property="grouping.uptodate" classpath.property="grouping.jar"/>
-  <module-uptodate name="queries" jarfile="${common.dir}/../modules/queries/build/lucene-queries-${version}.jar"
-        property="queries.uptodate" classpath.property="queries.jar"/>
-  <module-uptodate name="queryparser" jarfile="${common.dir}/../modules/queryparser/build/lucene-queryparser-${version}.jar"
-        property="queryparser.uptodate" classpath.property="queryparser.jar"/>
-  <contrib-uptodate name="highlighter" property="highlighter.uptodate" classpath.property="highlighter.jar"/>
-  <contrib-uptodate name="memory" property="memory.uptodate" classpath.property="memory.jar"/>
-  <contrib-uptodate name="misc" property="misc.uptodate" classpath.property="misc.jar"/>
-  <contrib-uptodate name="queries-contrib" contrib-src-name="queries" property="queries-contrib.uptodate" classpath.property="queries-contrib.jar"/>
-  <contrib-uptodate name="spatial" property="spatial.uptodate" classpath.property="spatial.jar"/>
+  <!-- solr depends on the following modules/contribs -->
+  <property name="analyzers-common.jar" value="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"/>
+  <property name="analyzers-phonetic.jar" value="${common.dir}/../modules/analysis/build/phonetic/lucene-analyzers-phonetic-${version}.jar"/>
+  <property name="suggest.jar" value="${common.dir}/../modules/suggest/build/lucene-suggest-${version}.jar"/>
+  <property name="grouping.jar" value="${common.dir}/../modules/grouping/build/lucene-grouping-${version}.jar"/>
+  <property name="queries.jar" value="${common.dir}/../modules/queries/build/lucene-queries-${version}.jar"/>
+  <property name="queryparser.jar" value="${common.dir}/../modules/queryparser/build/lucene-queryparser-${version}.jar"/>
+  <property name="highlighter.jar" value="${common.dir}/build/contrib/highlighter/lucene-highlighter-${version}.jar"/>
+  <property name="memory.jar" value="${common.dir}/build/contrib/memory/lucene-memory-${version}.jar"/>
+  <property name="misc.jar" value="${common.dir}/build/contrib/misc/lucene-misc-${version}.jar"/>
+  <property name="queries-contrib.jar" value="${common.dir}/build/contrib/queries-contrib/lucene-queries-contrib-${version}.jar"/>
+  <property name="spatial.jar" value="${common.dir}/build/contrib/spatial/lucene-spatial-${version}.jar"/>
+  <target name="check-analysis-common-uptodate" unless="analyzers-common.uptodate">
+    <module-uptodate name="analysis/common" jarfile="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"
+                     property="analyzers-common.uptodate" classpath.property="analyzers-common.jar"/>
+  </target>
+  <target name="check-analysis-phonetic-uptodate" unless="analyzers-phonetic.uptodate">
+    <module-uptodate name="analysis/phonetic" jarfile="${common.dir}/../modules/analysis/build/phonetic/lucene-analyzers-phonetic-${version}.jar"
+                     property="analyzers-phonetic.uptodate" classpath.property="analyzers-phonetic.jar"/>
+  </target>
+  <target name="check-suggest-uptodate" unless="suggest.uptodate">
+    <module-uptodate name="suggest" jarfile="${common.dir}/../modules/suggest/build/lucene-suggest-${version}.jar"
+                     property="suggest.uptodate" classpath.property="suggest.jar"/>
+  </target>
+  <target name="check-grouping-uptodate" unless="grouping.uptodate">
+    <module-uptodate name="grouping" jarfile="${common.dir}/../modules/grouping/build/lucene-grouping-${version}.jar"
+                     property="grouping.uptodate" classpath.property="grouping.jar"/>
+  </target>
+  <target name="check-queries-uptodate" unless="queries.uptodate">
+    <module-uptodate name="queries" jarfile="${common.dir}/../modules/queries/build/lucene-queries-${version}.jar"
+                     property="queries.uptodate" classpath.property="queries.jar"/>
+  </target>
+  <target name="check-queryparser-uptodate" unless="queryparser.uptodate">
+    <module-uptodate name="queryparser" jarfile="${common.dir}/../modules/queryparser/build/lucene-queryparser-${version}.jar"
+                     property="queryparser.uptodate" classpath.property="queryparser.jar"/>
+  </target>
+  <target name="check-highlighter-uptodate" unless="highlighter.uptodate">
+    <contrib-uptodate name="highlighter" property="highlighter.uptodate" classpath.property="highlighter.jar"/>
+  </target>
+  <target name="check-memory-uptodate" unless="memory.uptodate">
+    <contrib-uptodate name="memory" property="memory.uptodate" classpath.property="memory.jar"/>
+  </target>
+  <target name="check-misc-uptodate" unless="misc.uptodate">
+    <contrib-uptodate name="misc" property="misc.uptodate" classpath.property="misc.jar"/>
+  </target>
+  <target name="check-queries-contrib-uptodate" unless="queries-contrib.uptodate">
+    <contrib-uptodate name="queries-contrib" contrib-src-name="queries" property="queries-contrib.uptodate" classpath.property="queries-contrib.jar"/>
+  </target>
+  <target name="check-spatial-uptodate" unless="spatial.uptodate">
+    <contrib-uptodate name="spatial" property="spatial.uptodate" classpath.property="spatial.jar"/>
+  </target>
 
-  <target name="compile-analyzers-common" unless="analyzers-common.uptodate">
+  <target name="compile-analyzers-common" unless="analyzers-common.uptodate" depends="check-analysis-common-uptodate">
   	<ant dir="${common.dir}/../modules/analysis/common" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-analyzers-phonetic" unless="analyzers-phonetic.uptodate">
+  <target name="compile-analyzers-phonetic" unless="analyzers-phonetic.uptodate" depends="check-analysis-phonetic-uptodate">
   	<ant dir="${common.dir}/../modules/analysis/phonetic" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-suggest" unless="suggest.uptodate">
+  <target name="compile-suggest" unless="suggest.uptodate" depends="check-suggest-uptodate">
   	<ant dir="${common.dir}/../modules/suggest" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-grouping" unless="grouping.uptodate">
+  <target name="compile-grouping" unless="grouping.uptodate" depends="check-grouping-uptodate">
   	<ant dir="${common.dir}/../modules/grouping" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-queries" unless="queries.uptodate">
+  <target name="compile-queries" unless="queries.uptodate" depends="check-queries-uptodate">
   	<ant dir="${common.dir}/../modules/queries" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-queryparser" unless="queryparser.uptodate">
+  <target name="compile-queryparser" unless="queryparser.uptodate" depends="check-queryparser-uptodate">
   	<ant dir="${common.dir}/../modules/queryparser" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-highlighter" unless="highlighter.uptodate">
+  <target name="compile-highlighter" unless="highlighter.uptodate" depends="check-highlighter-uptodate">
   	<ant dir="${common.dir}/contrib/highlighter" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-memory" unless="memory.uptodate">
+  <target name="compile-memory" unless="memory.uptodate" depends="check-memory-uptodate">
   	<ant dir="${common.dir}/contrib/memory" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-misc" unless="misc.uptodate">
+  <target name="compile-misc" unless="misc.uptodate" depends="check-misc-uptodate">
   	<ant dir="${common.dir}/contrib/misc" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-queries-contrib" unless="queries-contrib.uptodate">
+  <target name="compile-queries-contrib" unless="queries-contrib.uptodate" depends="check-queries-contrib-uptodate">
   	<ant dir="${common.dir}/contrib/queries" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
-  <target name="compile-spatial" unless="spatial.uptodate">
+  <target name="compile-spatial" unless="spatial.uptodate" depends="check-spatial-uptodate">
   	<ant dir="${common.dir}/contrib/spatial" target="default" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
@@ -157,6 +190,7 @@
   	<ant dir="${common.dir}/contrib/xml-query-parser" target="compile-core" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
+    <property name="xml-query-parser.uptodate" value="true"/>
   </target>
 
   <path id="solr.base.classpath">
@@ -203,7 +237,7 @@
   </macrodef>
 
   <target name="validate" depends="validate-solr"/>
-  <target name="validate-solr" depends="check-legal-solr" unless="validated-solr"/>
+  <target name="validate-solr" depends="check-legal-solr" unless="validated-solr.uptodate"/>
 
   <target name="check-legal-solr" depends="compile-tools">
     <java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
@@ -237,7 +271,7 @@
       <arg value="-c" />
       <arg value="${common-solr.dir}/core/src/test-files/solr/lib" />
     </java>
-    <property name="validated-solr" value="true"/>
+    <property name="validated-solr.uptodate" value="true"/>
   </target>
   <path id="tools.runtime.classpath">
     <pathelement location="${common.dir}/build/classes/tools"/>
@@ -250,16 +284,19 @@
     <mkdir dir="${maven.dist.dir}"/>
   </target>
 
-  <target name="prep-lucene-jars"
-          depends="compile-analyzers-common, compile-analyzers-phonetic, compile-suggest,
+  <target name="prep-lucene-jars" 
+  	      depends="compile-analyzers-common, compile-analyzers-phonetic, compile-suggest,
                    compile-highlighter, compile-memory, compile-misc, compile-queries-contrib,
-                   compile-spatial, compile-grouping, compile-queries, compile-queryparser">
+  	               compile-spatial, compile-grouping, compile-queries, compile-queryparser">
+  	  <property name="solr.deps.compiled" value="true"/>
+  </target>
+	
+  <target name="lucene-jars-to-solr" depends="prep-lucene-jars">
+    <!-- TODO: clean this up -->
+    <sequential>
     <ant dir="${common.dir}" target="default" inheritall="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
-  </target>
-
-  <target name="lucene-jars-to-solr" depends="prep-lucene-jars">
     <copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
       <fileset file="${common.dir}/build/lucene-core-${version}.jar" />
       <fileset file="${analyzers-common.jar}" />
@@ -274,6 +311,7 @@
       <fileset file="${queries-contrib.jar}" />
       <fileset file="${spatial.jar}" />
     </copy>
+    </sequential>
   </target>
 
   <!-- Shared core/solrj/test-framework/contrib targets -->
@@ -285,6 +323,9 @@
             spec.version="${solr.spec.version}"/>
   </target>
 
+  <target name="compile-core" depends="prep-lucene-jars,common.compile-core"/>
+  <target name="compile-test" depends="compile-solr-test-framework,common.compile-test"/>
+
   <target name="dist" depends="jar-core">
     <copy file="${build.dir}/${fullnamever}.jar" todir="${dist}"/>
   </target>
@@ -361,14 +402,15 @@
     <ant dir="${common-solr.dir}/test-framework" target="compile-core" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
+  	<property name="solr.core.compiled" value="true"/>
     <property name="solr.test.framework.compiled" value="true"/>
   </target>
 
   <!-- Solr contrib targets -->
-  <target name="build-contrib" depends="compile-test"
-          description="Builds all contrib modules and their tests">
-    <contrib-crawl target="build-artifacts-and-tests"/>
+  <target name="compile-contrib" description="Compile contrib modules">
+  	<contrib-crawl target="compile-core"/>
   </target>
+
   <target name="contribs-add-to-war">
     <mkdir dir="${dest}/web"/>
     <delete dir="${dest}/web" includes="**/*" failonerror="false"/>
Index: solr/core/build.xml
===================================================================
--- solr/core/build.xml	(revision 1151075)
+++ solr/core/build.xml	(working copy)
@@ -20,15 +20,8 @@
 
   <import file="../common-build.xml"/>
 
-  <target name="compile-core" unless="solr.core.compiled"
-          depends="prep-lucene-jars, compile-solrj, common.compile-core">
-    <property name="solr.core.compiled" value="true"/>
-  </target>
+  <target name="compile-core" depends="compile-solrj,common-solr.compile-core"/>
 
-  <target name="compile-test" depends="compile-solr-test-framework,common.compile-test"/>
-
-  <target name="test" depends="compile-test,junit-mkdir,junit-sequential,junit-parallel"/>
-
   <target name="dist-maven" depends="jar-core,javadocs,jar-src,contrib-build.dist-maven">
     <m2-deploy-with-pom-template pom.xml="${common-solr.dir}/lib/solr-commons-csv-pom.xml.template"
                                  jar.file="${common-solr.dir}/lib/commons-csv-1.0-SNAPSHOT-r966014.jar" />
@@ -36,4 +29,4 @@
     <m2-deploy-with-pom-template pom.xml="${common-solr.dir}/lib/apache-solr-noggit-pom.xml.template"
                                  jar.file="${common-solr.dir}/lib/apache-solr-noggit-r1099557.jar" />
   </target>
-</project>
\ No newline at end of file
+</project>
Index: solr/solrj/build.xml
===================================================================
--- solr/solrj/build.xml	(revision 1151075)
+++ solr/solrj/build.xml	(working copy)
@@ -27,10 +27,6 @@
   	<path refid="test.base.classpath"/>
   </path>
 
-  <target name="compile-test" depends="compile-solr-test-framework,common.compile-test"/>
-
-  <target name="test" depends="compile-test,junit-mkdir,junit-sequential,junit-parallel"/>
-
   <target name="dist" depends="common-solr.dist">
     <mkdir  dir="${dist}/solrj-lib" />
     <copy todir="${dist}/solrj-lib">
Index: solr/build.xml
===================================================================
--- solr/build.xml	(revision 1151075)
+++ solr/build.xml	(working copy)
@@ -40,7 +40,7 @@
   <!-- ========================================================================= -->
  
   <target name="example" description="Creates a runnable example configuration."
-          depends="prep-lucene-jars,dist-contrib,dist-war,build-contrib">
+          depends="dist-contrib,dist-war">
     <copy file="${dist}/${fullnamever}.war"
           tofile="${example}/webapps/${ant.project.name}.war"/>
     <jar destfile="${example}/exampledocs/post.jar"
@@ -120,7 +120,7 @@
   <!-- ========================================================================= -->
   
   <target name="compile" description="Compile the source code."
-          depends="compile-core, build-contrib"/>
+          depends="compile-core, compile-contrib"/>
   <target name="test" description="Validate, then run core, solrj, and contrib unit tests."
           depends="validate-solr, test-core, test-jsp, test-contrib"/>
   <target name="test-core" description="Runs the core and solrj unit tests."
@@ -139,18 +139,21 @@
   
   <!-- Solrj targets -->
   <target name="test-solrj" description="Test java client">
-    <ant dir="solrj" target="test" inheritAll="false"/>
+    <ant dir="solrj" target="test" inheritAll="false">
+      <propertyset refid="uptodate.and.compiled.properties"/>
+    </ant>
   </target>
   
   <!-- Solr contrib targets -->
-  <target name="test-contrib" description="Run contrib unit tests."
-          depends="build-contrib">
+  <target name="test-contrib" description="Run contrib unit tests.">
     <contrib-crawl target="test" failonerror="true"/>
   </target>
   
   <!-- test-framework targets -->
   <target name="javadocs-test-framework">  <!-- Called from Jenkins build script --> 
-    <ant dir="test-framework" target="javadocs" inheritAll="false"/>
+    <ant dir="test-framework" target="javadocs" inheritAll="false">
+      <propertyset refid="uptodate.and.compiled.properties"/>
+  	</ant>
   </target>
   
   <!-- Webapp targets -->
Index: solr/contrib/dataimporthandler-extras/build.xml
===================================================================
--- solr/contrib/dataimporthandler-extras/build.xml	(revision 1151075)
+++ solr/contrib/dataimporthandler-extras/build.xml	(working copy)
@@ -30,7 +30,7 @@
                          classpath.property="solr-dataimporthandler.jar"/>
 
   <target name="compile-solr-dataimporthandler" unless="solr-dataimporthandler.uptodate">
-  	<ant dir="${common-solr.dir}/contrib/dataimporthandler" target="default" inheritAll="false">
+  	<ant dir="${common-solr.dir}/contrib/dataimporthandler" target="compile-core" inheritAll="false">
       <propertyset refid="uptodate.and.compiled.properties"/>
     </ant>
   </target>
@@ -54,5 +54,5 @@
   </path>
 
   <target name="compile-core" depends="compile-solr-dataimporthandler, solr-contrib-build.compile-core"/>
-  <target name="compile-test" depends="compile-solr-dataimporthandler-tests, contrib-build.compile-test"/>
+  <target name="compile-test" depends="compile-solr-dataimporthandler-tests, common-solr.compile-test"/>
 </project>
Index: solr/contrib/analysis-extras/build.xml
===================================================================
--- solr/contrib/analysis-extras/build.xml	(revision 1151075)
+++ solr/contrib/analysis-extras/build.xml	(working copy)
@@ -67,5 +67,6 @@
     </copy>
   </target>
 
-  <target name="compile-core" depends="module-jars-to-solr, solr-contrib-build.compile-core"/>
+  <target name="compile-core" depends="compile-analyzers-icu, compile-analyzers-smartcn, compile-analyzers-stempel, solr-contrib-build.compile-core"/>
+  <target name="dist" depends="module-jars-to-solr, common-solr.dist"/>
 </project>
Index: solr/contrib/contrib-build.xml
===================================================================
--- solr/contrib/contrib-build.xml	(revision 1151075)
+++ solr/contrib/contrib-build.xml	(working copy)
@@ -23,15 +23,8 @@
 
   <import file="../common-build.xml"/>
 
-  <target name="build-solr" unless="solr.core.compiled">
-    <ant dir="${common-solr.dir}/core" target="compile-test" inheritAll="false">
-      <propertyset refid="uptodate.and.compiled.properties"/>
-    </ant>
-    <property name="solr.core.compiled" value="true"/>
-  </target>
+  <target name="compile-core" depends="compile-solr-core,compile-solrj,common-solr.compile-core"/>
 
-  <target name="compile-core" depends="build-solr, common.compile-core"/>
-
   <!-- redefine common-solr.test, and exclude 'validate-solr' dependency, since it should only run at solr/ level -->
   <target name="test" depends="compile-test,junit-mkdir,junit-sequential,junit-parallel" description="Runs unit tests"/>
 
