More information about the Underscore mailing list

[_] netbeans jar targets

Jan Grant jan.grant at bristol.ac.uk
Tue May 1 09:39:08 BST 2007

On Tue, 1 May 2007, Alex Stanhope wrote:

> [Alan]
> Here are links to the files you mentioned:
> http://www.lightenna.com/sitefiles/lightenna.com/build.xml
> http://www.lightenna.com/sitefiles/lightenna.com/build-impl.xml
> http://www.lightenna.com/sitefiles/lightenna.com/project.xml
> 
> They currently compile the sources and produce a single .jar file (aqm.jar) 
> which contains all my code, leaving a dozen or so libraries as external 
> references.  What I'm trying to do is build a second .jar (ccd.jar) based on 
> a subset of my code (everything except the aqm folder), which compiles in 
> all the external libraries, to produce a single .jar solely dependent upon 
> the JRE.  I've included a file structure appendix below incase that's 
> relevant.
> 
> [Jan]
> > manifest.mf or MANIFEST.MF? (Actually you can just supply these
> > parameters directly to the jar task in ant IIRC, and it should do the
> > right thing.)

What I said about the nested jar files appears to still be true with a 
stock classloader. Looks to me like the external reference in the 
Class-Path: attribute should work (ie, your aqm.jar).

To put everything together in one executable .jar: you can either use a 
custom classloader to haul in nested .jar files (there are several 
examples of this kind of thing knocking around); or, you can expand all 
the .jar file contents into one large class hierarchy and then jar them 
up together. The latter approach should work (assuming that your 
dependency jar files don't do anything clever themselves with nexted 
classloaders :-) ) BUT you may be in violation of the 
packaging/licensing requirements of those libraries, depending on what 
those details are.

(Having said that: I've no idea what netbean's "copylibs" task is. It 
might well do that for you already.)



-- 
jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/
Tel +44 (0)117 3317661   http://ioctl.org/jan/
"Roger Penrose can never be convinced that this sentence is true."
(If he doesn't get the joke, you can at least prove that he owes you money.)