Bug 16428 - Avoid requirement of putting jars in ant/lib
Summary: Avoid requirement of putting jars in ant/lib
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.5.1
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-26 03:50 UTC by Per Velschow
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Per Velschow 2003-01-26 03:50:38 UTC
Now that Ant has chosen to define a lot of optional tasks via the optional.jar 
in the ant/lib directory, we are forced to put the required 3rd party libraries 
in that directory. To me that is work only half done. 

I do understand that the Ant distribution cannot include all the required 
libraries (due to license and maintenance issues). But this requirement is the 
only thing that prevents us from checking all the needed libraries for a 
project into a source control system and simply asking users to checkout and 
type ant. 

Ok, that was the problem. Here is how I think it could be solved. There are a 
few ways as I see it. 

Option 1) AFAIK, Ant implements its own ClassLoader. Wouldn't it be possible to 
somehow pass the location of required libraries to that class loader at startup 
time? 

Option 2) Extend the Ant wrapper scripts with a classpath argument that will be 
appended to the the classpath before executing Ant. 

Option 3) Extend the Ant wrapper scripts so that it will include a .antrc from 
the directory of the build file. 

The first option is in my view the right way of doing it. The second and third 
are a work-arounds that for most cases would probablt be good enough. 

I am aware that you can have the wrapper scripts read a .antrc from the user's 
home directory. But this is not good enough because different projects have 
different library requirements.
Comment 1 Jan Mat 2004-04-20 13:31:10 UTC
Ant 1.6 uses a new Launcher. I adds all JARs in the ANT_HOME/lib, 
USERHOME/.ant/lib and all JARs added via -jar option to Ant´s classpath.