You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2002/01/23 13:36:32 UTC

Re: Including other JAR files when building a redistributable JAR file

On Wed, 23 Jan 2002, chris brown <de...@reflexe.fr> wrote:

> can I bundle the third-party jar files *within* my jar files (from a
> technical viewpoint, ignoring licencing issues)?

Not the jars itself, but the content of them (i.e. unzip them first) -
you could use <zipfileset> for this.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Including other JAR files when building a redistributable JAR file

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 23 Jan 2002, chris brown <de...@reflexe.fr> wrote:

> I had thought of this, but this might cause problems with regards to
> sealed jars, signed jars, etc.

Don't copy the META-INF directories, at least not the manifest or any
signatures.  I don't think you'd get into trouble then.

> Furthermore, some jar resources (such as images and conf files) will
> not necessarily be stored in folders that follow the
> "reverse-domain-name" package convention that is generally used to
> organise code into packages.

If the classes in the original jar file could find them, they should
still be able to do so.

> I was looking for some sort of parallel to WAR files, in which it's
> clear that the /WEB-INF/lib path can contain other jars.

To parallel something like that, you could write a class loader of
your own and make your application use that one.  No other solution
AFAIK.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Including other JAR files when building a redistributable JAR file

Posted by Charles Horan <ct...@sympatico.ca>.
The maifest file can contain a Class-Path directive
This class path indicates where to search for other classes when running you
application.

You can then distribute the other jar files with you app in case the end
uses does not already have them.

i.e.:
Class-Path: lib/log4j.jar lib/comhoranutil.jar

-----Original Message-----
From: chris brown [mailto:dev@reflexe.fr]
Sent: January 23, 2002 7:59 AM
To: Ant Users List
Subject: Re: Including other JAR files when building a redistributable
JAR file


I had thought of this, but this might cause problems with regards to sealed
jars, signed jars, etc.  Furthermore, some jar resources (such as images and
conf files) will not necessarily be stored in folders that follow the
"reverse-domain-name" package convention that is generally used to organise
code into packages.

I was looking for some sort of parallel to WAR files, in which it's clear
that the /WEB-INF/lib path can contain other jars.  However, I can't just do
the same with other archives, because the JVM won't look there...

Any other ideas?

Thanks again,
Chris

----- Original Message -----
From: "Stefan Bodewig" <bo...@apache.org>
To: <an...@jakarta.apache.org>
Sent: Wednesday, January 23, 2002 1:36 PM
Subject: Re: Including other JAR files when building a redistributable JAR
file


> On Wed, 23 Jan 2002, chris brown <de...@reflexe.fr> wrote:
>
> > can I bundle the third-party jar files *within* my jar files (from a
> > technical viewpoint, ignoring licencing issues)?
>
> Not the jars itself, but the content of them (i.e. unzip them first) -
> you could use <zipfileset> for this.
>
> Stefan
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Including other JAR files when building a redistributable JAR file

Posted by chris brown <de...@reflexe.fr>.
I had thought of this, but this might cause problems with regards to sealed
jars, signed jars, etc.  Furthermore, some jar resources (such as images and
conf files) will not necessarily be stored in folders that follow the
"reverse-domain-name" package convention that is generally used to organise
code into packages.

I was looking for some sort of parallel to WAR files, in which it's clear
that the /WEB-INF/lib path can contain other jars.  However, I can't just do
the same with other archives, because the JVM won't look there...

Any other ideas?

Thanks again,
Chris

----- Original Message -----
From: "Stefan Bodewig" <bo...@apache.org>
To: <an...@jakarta.apache.org>
Sent: Wednesday, January 23, 2002 1:36 PM
Subject: Re: Including other JAR files when building a redistributable JAR
file


> On Wed, 23 Jan 2002, chris brown <de...@reflexe.fr> wrote:
>
> > can I bundle the third-party jar files *within* my jar files (from a
> > technical viewpoint, ignoring licencing issues)?
>
> Not the jars itself, but the content of them (i.e. unzip them first) -
> you could use <zipfileset> for this.
>
> Stefan
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>