Currently there is a list of packages on which ant might depend hardcoded into /usr/bin/ant. It would be nice if this could be overridden by an environment variable (or command line switch). So far I had two situations where this would be helpful: 1. compiling with java 1.4 but some dependencies were built using 1.5 and thus caused ant to fail. 2. using a development snapshot from cup but the older cup bundled with xalan took precedence and caused the new cup ant task to fail.
Although this may be a nice to have, it really isn
Although this may be a nice to have, it really isn´t a pressing issue. But by all means, feel free to submit a patch if you find a good way of achieving this.
Created attachment 75800 [details, diff] patch against ant-core/files/1.6.5-ant This patch introduces a new environment variable named ANT_PACKAGES. If this is set, it contains the comma seperated list of java packages that will be included in the class path, otherwise the list that was hardcoded so far is used instead. ANT_PACKAGES may be set to the special value "-", in which case no packages at all will be appended to the classpath. Error messages from java-config will only be suppressed if the implicit list is used, because whenever a list is provided externally, the user most likely expects those commands to be present.
It will probably be changed soonish to only use symlinks in ANT_HOME and have the ant classloader pick things up
If things are moved over to symlinks, there seems to be no way to disable packages using environment settings, so you'd have to build a complete ant lib dir with the packages you want to use. On the other hand, you can use the -lib command line switch to include packages that take precedence over any symlinks. This can be usedto address the second problem I described. On the whole, the bug description and my patch won't apply to a symlink based approach to ant dependencies.
Latest java-utils-2 disables ant's classpath when JAVA_PKG_STRICT is set: 1299 if is-java-strict; then 1300 einfo "Disabling system classpath for ant" 1301 antflags="${antflags} -Dbuild.sysclasspath=ignore" 1302 fi See http://ant.apache.org/manual/sysclasspath.html