On Tue, 30 Sep 2003 05:04 am, Dale Anson wrote: > I don't claim to understand the details of what ant-launcher is supposed > to do,
ant-launcher is supposed to setup an appropriate classloader hierarchy to launch ant. In particular it is the minimal set of classes is required to be on the classpath to start Ant. The remaining jars, including the XML parser, ant.jar and the optional jars and any support jars are then loaded onto a single classloader which is used to launch Ant. If you combine ant.jar and ant-launcher into a single jar, it will work for at least some basic ant functions (and maybe more). What this does, however, is to create a two level classloader - one containing ant.jar and a child containing the optional jars and the support libraries. Dynamic loading across this classloader boundary is one way. So classes in ant.jar may not be able to dynamically load classes in the optional jars, etc. For example, trying to use your combo jar directly you will be unable to find the javac compiler - you need to add that to the classpath used to launch your jar. Even then you will not be able to run junit event though everything is in place. compile-tests: Skipped because property 'junit.present' not set. > I get: > Apache Ant version 1.6alpha compiled on September 9 2003 > Unfortunately this is not a useful test since it does not involve any dynamic class loading. Try using junit. > > I spent some time yesterday trying to find the minimum set of jars files > required to run Ant, and by doing the above, I only need one jar. I'm > sure there must be a good reason to have the ant-launcher classes in a > separate jar, but obviously I don't know what it is or I wouldn't be > rambling on about it! > That's cool. I hope the above explains it. You really need to keep launcher separate as the minimal launch code so everything else ends up in the appropriate classloader. You can repackage things but if you do, you need to put *everything* into the one jar including the optional task support jars :-) Conor --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]