Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111227 - ant: configure list of packages included in classpath
Summary: ant: configure list of packages included in classpath
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Lowest enhancement (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 04:18 UTC by Martin von Gagern
Modified: 2006-08-15 04:22 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch against ant-core/files/1.6.5-ant (bug111227-ant.patch,975 bytes, patch)
2005-12-30 08:14 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2005-11-02 04:18:10 UTC
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.
Comment 1 Josh Nichols (RETIRED) gentoo-dev 2005-12-26 16:31:15 UTC
Although this may be a nice to have, it really isn
Comment 2 Josh Nichols (RETIRED) gentoo-dev 2005-12-26 16:31:15 UTC
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.
Comment 3 Martin von Gagern 2005-12-30 08:14:17 UTC
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.
Comment 4 Thomas Matthijs (RETIRED) gentoo-dev 2005-12-30 14:29:34 UTC
It will probably be changed soonish to only use symlinks in ANT_HOME
and have the ant classloader pick things up
Comment 5 Martin von Gagern 2005-12-31 07:40:48 UTC
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.
Comment 6 Krzysztof Pawlik (RETIRED) gentoo-dev 2006-08-15 04:22:33 UTC
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