Please modify the junitreport task so that it will take a nested classpath element. Right now, you have to put teh xalan and xerces jar files in your main classpath, which reaks havoc for some IDE's. The build file should be self-referential so that when properly written it would run even if the CLASSPATH variable had been unset.
You are correct that putting things in CLASSPATH breaks other things; Ant will work with CLASSPATH="" which is how I run. You need to put the dependent jars into ANT_HOME/lib and they will be automatically picked up. I am not sure if adding a classpath would work, as xerces cannot be in a subsiduary classloader from JAXP and be discoverable, (one of the many miracles of classpaths), so the task would work without forking a whole new instance of ant. So I am tempted to file this as WONTFIX, but I'll leave that to someone else who can confirm the problem.
Steve, Thanks for the quick reply. Putting xalan.jar and xerces.jar into ANT_HOME/lib did indeed solve the problem. How about just shipping the xalan.jar and xerces.jar files with ant? That way, someone could download ant and have everything all ready to run right out of the box. If that is too expensive because of their size, maybe the junitreport manual page could contain some notice or instructions letting end users know to put the two files into ANT_HOME/lib in order to get it to work.
Bobby, You are only thinking about your personal case. Keep in mind that all other optional tasks require some other third party. It would be terrible to ship Ant with all dependencies and what about commercial products then ? The Ant installation is described in details in the manual. Section 'Install Ant'. See here: http://jakarta.apache.org/ant/manual/install.html If it is not clear, feel free to send patches to enhance the manual.
Stephane, Thanks for the note. Here's a patch for the install.html file given in your link listing the dependencies for junitreports. I used 'diff -u new_file.html old_file.html' to generate it. Cheers ##### PATCH BEGINS ####### --- junitreports_install.html Mon Jan 14 16:55:11 2002 +++ install.html Mon Jan 14 16:55:26 2002 @@ -267,15 +267,6 @@ <td><a href="http://www.junit.org/" target="_top">www.junit.org</a></td> </tr> <tr> - <td>xalan.jar, xerces.jar</td> - <td>junitreport tasks</td> - <td> - <a href="http://xml.apache.org/xalan-j/index.html"> - http://xml.apache.org/xalan-j/index.html - </a> - </td> - </tr> - <tr> <td>stylebook.jar</td> <td>stylebook task</td> <td>CVS repository of <a href="http://xml.apache.org" target="_top">xml.apache.org</a></td> ##### PATCH ENDS #######
*** This bug has been marked as a duplicate of 6606 ***