Chris: As mentioned in the Solr FAQ, (and the Ant FAQ) for proper JUnit/Ant integration, the JUnit jars need to be in the ANT_HOME/lib directory. (the build file was modified just after 1.1.0 was released to make this error more informative). If JUnit is installed in this way, no special classpath settings are needed for the <javac> tasks to work properly. (Are you finidng that this is not the case on your system?)
(the javadoc path hoopla you noticed is for dealing with the fact that unlike <javac>, the <javadoc> task does not automatically inherit any classpath elements from ant) : Date: Sat, 6 Jan 2007 17:28:07 -0800 : From: Chris Schneider <[EMAIL PROTECTED]> : Reply-To: [email protected] : To: [email protected] : Subject: Ant build.xml for solr-base (v1.1.0) broken? : : Solr Developers, : : I'm unable to successfully run the v1.1.0 Ant build.xml's compile : target (on which the dist target depends), because JUnit isn't in the : classpath. I note that at least one other solr user has apparently : run into the same problem (see : <http://www.mail-archive.com/[email protected]/msg01004.html> : for details). : : The build.xml's compile target uses the compile.classpath path, which : doesn't include any JUnit JARs (note that ${lib} here refers to the : lib directory within the solr project itself, which doesn't contain a : JUnit JAR either): : : <path id="compile.classpath"> : <fileset dir="${lib}"> : <include name="*.jar" /> : </fileset> : </path> : : The problem is that org.apache.solr.util.AbstractSolrTestCase imports : junit.framework.TestCase, so when the compile target tries to compile : it (along with all other .java files inside src/java/), this JUnit : package isn't in the classpath, so I get the following error: : : Buildfile: /Users/schmed/Projects/Krugle/solr-base/build.xml : compile: : [mkdir] Created dir: /Users/schmed/Projects/Krugle/solr-base/build : [javac] Compiling 155 source files to : /Users/schmed/Projects/Krugle/solr-base/build : [javac] : /Users/schmed/Projects/Krugle/solr-base/src/java/org/apache/solr/util/AbstractSolrTestCase.java:25: : package junit.framework does not exist : [javac] import junit.framework.TestCase; : [javac] ^ : [javac] : /Users/schmed/Projects/Krugle/solr-base/src/java/org/apache/solr/util/AbstractSolrTestCase.java:44: : cannot find symbol : : I note that when solr first started using JUnit, others apparently : ran into this missing classpath entry problem when building the : javadoc target, and I see rather elaborate handling of this : (essentially getting the JUnit JAR from the Ant Library folder) in : the build.xml for that target's special javadoc.classpath path: : : <path id="javadoc.classpath"> : <path refid="compile.classpath"/> : <!-- aparently ant.library.dir isn't allways set right? --> : <fileset dir="${ant.home}/lib"> : <include name="**/*.jar"/> : </fileset> : <fileset dir="${ant.library.dir}"> : <include name="**/*.jar"/> : </fileset> : </path> : : I'm puzzled why the same isn't true for the compile target. : : Any help would be greatly appreciated. : : Thanks, : : - Chris : : -- : ---------------------------- : Chris Schneider : Krugle, Inc. : http://www.krugle.com : ---------------------------- : -Hoss
