Community
Participate
Working Groups
The Ant ui does it own parsing of the build file to get the list of targets. It cannot use the ProjectHelper class from Ant because the Ant version shipped with Eclipse (as of release 2.0) is version 1.4, and that version does not handle 1.5 Ant build files. When parsing the file, we tell the parser what the base directory is and also provide an EntityResolver to handle SYSTEM values with start with the protocol "file:" All other values are left to the XML parser to handle. Unfortunately, not all XML parser will handle relative paths such as "../../common.xml" properly. It seems to depend on the JRE being used and which parser is registered to be used. The org.apache.crimson parser is one that will not handle relative paths properly (it seems to want a valid URI only). We need to update our Entity Resolver to handle this case and not leave it to the default parser. In other words, it should handle values that start with "file:" or values that do not have a protocol in front of it (like "../../common.xml"). It is very important that we do not handle values with other protocol (like "http:", etc). The AntRunner will also parse the build file when asked to run it. However, it uses the SAXParser always and has it's own Entity Resolver, so it does not have this problem - build files always seen to run correctly. For background reference, please see the following problem reports (bug 18692 and bug 20635)
For release 2.0, this limitation will be documented in the readme. The workaround is for people to add the "file:" protocol to their paths. For example, instead of <!ENTITY custom SYSTEM "../../custom.xml"> use <!ENTITY custom SYSTEM "file:/../../custom.xml">
Note that <!ENTITY custom SYSTEM "file:/../../custom.xml"> does not work on Linux. It has to be <!ENTITY custom SYSTEM "file:../../custom.xml"> .
The ant external tool support should no longer try to parse the XML Ant build file to get the list of targets. Instead, it should call AntRunner.getTargets() in ant.core plugin. (We can drop all the code in AntUtil dealing with reading in targets, including the entity resolver code). To be fixed in 2.0.1
*** Bug 21798 has been marked as a duplicate of this bug. ***
Fixed in the 2.0.1 code stream. Opened bug 22273 to port fix to 2.1 code stream.