ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47003] Add to ant lib classpath from within project file
Date Tue, 01 Jun 2010 16:45:47 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47003

--- Comment #4 from Martin von Gagern <Martin.vGagern@gmx.net> 2010-06-01 12:45:44 EDT
---
(In reply to comment #3)
> My preference would be for fixes to particular tasks (such as bug #47002) to
> ensure that any necessary libraries can be supplied using a regular
> <classpath> element.

I agree that this should be an option, for cases where tweaking the main class
path are either impossible or a worse alternative. But one approach doesn't
precluse the other; if we can have both ways to address the issue, why not
expose them both to developers in a fairly usable way, and let them decide what
works best for them?

> Injecting JARs into the main Ant classpath has at least two
> disadvantages:
> 
> 1. It breaks modularity for large builds, parts of which may have different
> expectations about library versions and so on.

In my experience, many large projects tend to ship a shell script and batch
file which builds a class path to be passed to the java vm running ant, in
order to ensure that all required things are available on the ant class path
and able to cooperate smoothly. So in those cases, having a single target in
build.xml replace the two shell scripts certainly is a benefit.

In cases where you really and truly need different library versions on the
classpath for different tasks, then there should be a <classpath> element to
configure this, but I consider this a rare case so developers shouldn't be
forced to juggle class paths for those 98% of projects that can work quite well
with a single homogenous classpath.

> 2. It will likely not work when Ant is run in an embedded environment. In
> particular, Main is not used at all when run from NetBeans and possibly other
> containers.

Good point. Do you know of some unique entry point suitable for this classpath
manipulation?

I'm willing to improve my patch further, but I'd like to know if this whole
approach has a chance of landing in ant core one day, before I invest any more
of my free time into coding improvements. Seeing that even the simpler bug
#47002 has been open for well over a year without so much as a comment, I feel
a bit pessimistic there.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message