ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chris brown" <...@reflexe.fr>
Subject Packaging multiple JARs (WAS: Using Main-Class and Class-Path in a manifest file)
Date Wed, 13 Mar 2002 08:29:10 GMT

Hi all,

I asked this question in the past, and came to the conclusion that there's
no simple way to do this.  I've posted this as a RFE on Sun's Java site, so
if you're interested... vote for it! :-)

http://developer.java.sun.com/developer/bugParade/bugs/4648386.html

My current solution is to deploy applications in a zip file like this:

[ZIP]
 |
 +--appli.jar
 |
 +--lib/
 |   |
 |   +--abc.jar
 |   |
 |   +--def.jar
 |   |
 |   +--ghi.jar
 |
 +--appli.bat
 |
 +--appli.sh

...where "appli.jar" contains a manifest with a "Main-Class:" attribute
pointing to some class in "appli.jar", and the other jars are referred to
from the "Class-Path:" attribute in "appli.jar"'s manifest too (values such
as "lib/abc.jar").  Just to make it perfectly clear, I didn't embed the
other jars inside each other: they're available close to each other on-disk
(after unzipping).

The "bat" and "sh" files contain lines such as:
java -jar appli.jar <params>

...because sometimes such a line is impractical or difficult for users to
understand.

The other workaround is to use a custom classloader, but you really to have
a good reason to go to such trouble... (IMHO).

-Chris B.



----- Original Message -----
From: "Diane Holt" <holtdl@yahoo.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>; <todd_wilson@byu.edu>
Sent: Wednesday, March 13, 2002 1:43 AM
Subject: Re: Using Main-Class and Class-Path in a manifest file


> --- Todd Wilson <todd_wilson@byu.edu> wrote:
> > It's not an absolute necessity for us to include everything in a single
> > jar file, but it is a convenience.
>
> Would there be a problem with sticking the individual log4j files into
> your jar (as opposed to putting them in as a jar themselves)?  If you did
> that then it should work (right?), and you'd still have a single jar file.
>
> Diane
>
> =====
> (holtdl@yahoo.com)
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Try FREE Yahoo! Mail - the world's greatest free email!
> http://mail.yahoo.com/
>
> --
> 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