: 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

It wasn't an explict decision on my part, so much as the convention:
a) recommended by the Ant FAQ; b) in use in the Java Lucene build system;
and c) recommended by Erik Hatcher (whom i trust to know Ant better then
anyone else i've ever talked to, even if i haven't had a chance to read
either of his books on the subject) ...

http://www.nabble.com/Re%3A-inital-observations-from-a-newbie-p2970514.html
http://www.nabble.com/Re%3A-Contrib-in-oblivion-p1458269.html
http://ant.apache.org/faq.html#delegating-classloader

: 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

ANT_HOME/lib/ seems to be the recommended place to put it ... if you build
with eclipse and ecplise prefers another place you should still be fine
for compiling -- as long as that other place is in whatever default
CLASSPATH ecplise sets up for you (even if the Solr build.xml went out of
it's way to try and find it for the <javac> tasks the way it does for
<javadoc> as you suggested before, that wouldn't help if ecplise keeps it
someplace completley different then ANT_HOME/lib/)

: 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?

I wasn't aware that Nutch/Hadoop included it in their lib dir -- but even
if they do, it doesn't mean they get arround the classpath problem.  I
just tried checking Nutch out of subversion and found that with ant 1.6.5,
i could not run the "ant test" target for nutch without my personally copy
of the junit JAR in my ANT_HOME/lib directory.  I got this error from ant
(which is what I expected)...



BUILD FAILED
/home/chrish/tmp/nutch-svn/nutch-trunk/build.xml:265: Could not create
task or type of type: junit.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
 - You have misspelt 'junit'.
   Fix: check your spelling.
 - The task needs an external JAR file to execute
     and this is not found at the right place in the classpath.
   Fix: check the documentation for dependencies.
   Fix: declare the task.
 - The task is an Ant optional task and the JAR file and/or libraries
     implementing the functionality were not found at the time you
     yourself built your installation of Ant from the Ant sources.
   Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
     task and make sure it contains more than merely a
META-INF/MANIFEST.MF.
     If all it contains is the manifest, then rebuild Ant with the needed
     libraries present in ${ant.home}/lib/optional/ , or alternatively,
     download a pre-built release version from apache.org
 - The build file was written for a later version of Ant
   Fix: upgrade to at least the latest release version of Ant
 - The task is not an Ant core or optional task
     and needs to be declared using <taskdef>.
 - You are attempting to use a task defined using
    <presetdef> or <macrodef> but have spelt wrong or not
   defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.

Total time: 16 seconds

Reply via email to