ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: ant jar task
Date Tue, 16 Jul 2002 16:27:20 GMT
You can package JARs inside a JAR (in META-INF/lib or anywhere else), but
it's a packaging solution (for webapps usually) only. The webapp is unpacked
before being used, thus the JARs are normal files in the filesystem again.
You cannot use JARs inside JARs on the classpath (this the CDFE you're
getting) with normal JDK.

That said, JBoss has a little custom Java protocol extension
(URLStreamHandler) for 'nested jars', with the njar: prefix. This protocol
extension just copies the 'internal' jars on the file system before using
them, and I don't know how solid it does all that, so I would personally not
use it.

So no, writing a custom Manifest (!?!?!?) would not help here. Java class
loaders (as implemented by the JDK) do not know how classes of JARs inside
JARs. --DD

-----Original Message-----
From: Suncire, Joe [mailto:Joe.Suncire@qwest.com] 
Sent: Tuesday, July 16, 2002 10:50 AM
To: 'ant-user@jakarta.apache.org'
Subject: ant jar task

Hi,
	Using Ant 1.4, I would like to create a JAR that allows classes in
the JAR to reference other classes that are bundled in additional JARs that
exist in the META-INF/lib directory of the main jar.    In other words, I'm
wanting to package JARs within another JAR.

	Is the legal?   If so, do I have write a custom Manifest file to
allow the Jars under META-INF/lib to be seen?  Currently getting
ClassDefNotFoundError's at runtime.

Thanks


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message