DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20210>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20210 Need method to get absolute path of Jar in <classpath> definition. Summary: Need method to get absolute path of Jar in <classpath> definition. Product: Ant Version: 1.5.3 Platform: All OS/Version: Other Status: NEW Severity: Critical Priority: Other Component: Core AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I looked at the Java code for Path and PathElement classes. These two classes are used in ANT scripts to implement path blocks such as: <classpath> <pathelement path="lib1,lib2" /> <pathelement localion="lib/mylib.jar"> </classpath> I am writing an ANT task that scans previously defined Jars (as above) and calls the JUnit tests on them. The point is that I want to use a previously defined Jar inside of <classpath>. The obvious way is to use id references since ANT is XML. I can do that by putting id attribute and rely on XML to do the rest. <classpath> <pathelement path="lib1,lib2" /> <pathelement id="ref.mylib" localion="lib/mylib.jar"> </classpath> However once the <pathelement> (i.e. the object of type Path.PathElement), how can I get the absolute file path to the Jar file? Intuitively, there should be a pointer back to the containing Path object. I don't see it! Also, there should be some sort of search method on the Path object to look for the absolute path to the Jar file. We can assume that the Jar file exists because the <classpath> has already run int the 'init' target. You might say that the <classpath> block is only declarative and that the Java, JavaDoc or similar programs will determine if the Jar file exists. I will point out that there is a real necessity for a search method to look whether the Jar file exists or not. Furthermore, I suspect that this code already exists in your class loader. I will seach for it. Such search method should be in the Path class. Regards, Colbert Philippe