Index: solr/common-build.xml
===================================================================
--- solr/common-build.xml	(revision 1243176)
+++ solr/common-build.xml	(working copy)
@@ -123,47 +123,10 @@
   </macrodef>
 
   <target name="validate" depends="validate-solr"/>
-  <target name="validate-solr" depends="check-legal-solr" unless="validated-solr.uptodate"/>
+  <target name="validate-solr" depends="check-legal"/>
 
-  <target name="check-legal-solr" depends="compile-tools">
-    <java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
-      <classpath>
-        <path refid="tools.runtime.classpath" />
-      </classpath>
-      <!-- TODO: it might be better to just automatically find all directories that contain jar files, but that could take a
-       long time.  This should be faster, but we could miss a directory
-       -->
-      <!-- Solr -->
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/contrib/analysis-extras/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/contrib/clustering/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/contrib/dataimporthandler/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/contrib/dataimporthandler-extras/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/contrib/extraction/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/contrib/uima/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/contrib/velocity/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/example/example-DIH/solr/db/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/example/example-DIH/solr/mail/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/example/example/lib" />
-      <arg value="-c" />
-      <arg value="${common-solr.dir}/core/src/test-files/solr/lib" />
-    </java>
-    <property name="validated-solr.uptodate" value="true"/>
-  </target>
-  <path id="tools.runtime.classpath">
-    <pathelement location="${common.dir}/build/tools/classes/java"/>
-  </path>
+  <!-- Override common.test to depend on validate-solr instead of validate-lucene -->
+  <target name="test" depends="compile-test,validate-solr,junit-mkdir,junit-sequential,junit-parallel" description="Runs unit tests"/>
 
   <target name="init-dist" >
     <mkdir dir="${build.dir}"/>
Index: solr/core/build.xml
===================================================================
--- solr/core/build.xml	(revision 1243176)
+++ solr/core/build.xml	(working copy)
@@ -22,6 +22,25 @@
 
   <target name="compile-core" depends="compile-solrj,common-solr.compile-core"/>
 
+  <target name="check-legal" depends="compile-tools">
+    <java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
+      <classpath>
+        <path refid="tools.runtime.classpath" />
+      </classpath>
+      <!-- Check all non-contrib Solr lib/ directories -->
+      <arg value="-c" />
+      <arg value="${common-solr.dir}/lib"/>
+      <arg value="-c" />
+      <arg value="${common-solr.dir}/example/lib"/>
+      <arg value="-c"/>
+      <arg value="${common-solr.dir}/example/lib/jsp-2.1"/>
+      <arg value="-c" />
+      <arg value="${common-solr.dir}/example/example-DIH/solr/db/lib"/>
+      <arg value="-c" />
+      <arg value="${common-solr.dir}/example/example-DIH/solr/mail/lib"/>
+    </java>
+  </target>
+
   <target name="dist-maven" depends="jar-core,javadocs,jar-src,common.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" />
Index: solr/build.xml
===================================================================
--- solr/build.xml	(revision 1243176)
+++ solr/build.xml	(working copy)
@@ -130,7 +130,7 @@
   <target name="compile" description="Compile the source code."
           depends="compile-core, compile-contrib"/>
   <target name="test" description="Validate, then run core, solrj, and contrib unit tests."
-          depends="validate-solr, test-jsp, test-core, test-contrib"/>
+          depends="test-jsp, test-core, test-contrib"/>
   <target name="test-core" description="Runs the core and solrj unit tests."
           depends="test-solr-core, test-solrj"/>
   <target name="compile-test" description="Compile unit tests."
Index: solr/contrib/contrib-build.xml
===================================================================
--- solr/contrib/contrib-build.xml	(revision 1243176)
+++ solr/contrib/contrib-build.xml	(working copy)
@@ -25,9 +25,6 @@
 
   <target name="compile-core" depends="compile-solr-core,compile-solrj,common-solr.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"/>
-
   <dirname file="${ant.file}" property="antfile.dir"/>
 
   <available property="contrib.has.webapp" type="dir" file="${antfile.dir}/src/webapp" />
Index: lucene/common-build.xml
===================================================================
--- lucene/common-build.xml	(revision 1243176)
+++ lucene/common-build.xml	(working copy)
@@ -955,24 +955,19 @@
 
   <!-- VALIDATION work -->
 
-  <target name="check-legal-lucene" depends="compile-tools">
+  <available type="dir" file="lib" property="lib.dir.present"/>
+  <target name="check-legal" depends="compile-tools" if="lib.dir.present">
     <java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
       <classpath>
         <path refid="tools.runtime.classpath" />
       </classpath>
-      <!-- TODO: it might be better to just automatically find all directories that contain jar files, but that could take a
-       long time.  This should be faster, but we could miss a directory
-       -->
-      <!-- Lucene  -->
       <arg value="-c" />
-      <arg value="${common.dir}/lib" />
+      <arg value="lib" />
     </java>
   </target>
 
-  <target name="check-legal" depends="check-legal-lucene"/>
+  <target name="validate-lucene" depends="check-legal"/>
 
-  <target name="validate-lucene" depends="check-legal-lucene" unless="validated-lucene"/>
-
   <!-- Generic placeholder target for if we add other validation tasks -->
   <target name="validate" depends="validate-lucene"/>
 
Index: lucene/core/build.xml
===================================================================
--- lucene/core/build.xml	(revision 1243176)
+++ lucene/core/build.xml	(working copy)
@@ -57,6 +57,16 @@
     </sequential>
   </target>
 
+  <target name="check-legal" depends="compile-tools">
+    <java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
+      <classpath>
+        <path refid="tools.runtime.classpath" />
+      </classpath>
+      <arg value="-c" />
+      <arg value="${common.dir}/lib" />
+    </java>
+  </target>
+
   <macrodef name="createLevAutomaton">
   	<attribute name="n"/>
   	<sequential>
