lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Schneider <>
Subject Re: Ant build.xml for solr-base (v1.1.0) broken?
Date Mon, 08 Jan 2007 20:10:36 GMT
Chris H.,

>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)

Thanks for the clarification. I'm still not sure why you decided to let Ant control the version
of JUnit that Solr gets to use (by expecting the JUnit JAR to be in ANT_HOME/lib). My Eclipse
installation places the Ant and JUnit JARs into different folders within its plugins/ folder,
so it would seem awkward for me to put another copy of the JUnit JAR into my ANT_HOME/lib/.
I would imagine that different projects might want to use different versions of JUnit, which
is why other projects I've used (e.g., Nutch, Hadoop) typically put the JUnit JAR into their
own lib/ folders. Would you please elaborate on why doing so in the Solr project would make
for improper JUnit/Ant integration?


- Chris S.

>: Date: Sat, 6 Jan 2007 17:28:07 -0800
>: From: Chris Schneider <>
>: Reply-To:
>: To:
>: 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
>: <>
>: 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/
>: 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/
>: 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.
>: ----------------------------

Chris Schneider
TransPac Software, Inc.

View raw message