You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Fyodor Golos <fe...@resgen.com> on 2001/11/02 22:18:02 UTC

combining contents of multiple jar files (and directories)

Is it possible to create one jar file containing contents of mutiple
other jar files? I can currently achieve such behavior with optional
task jlink. However, jlink has multiple limitations and annoyances.

First of all, it does not check whether only a subset of files needs to
be updated. It goes through the whole process every single time. Zip
task, for example, can save me a huge amount of time by not executing
anything at all if nothing has changed.

Secondly, I would love to use filesets to provide a list of jar files to
combine. For example:

<jar jarfile="dist/combined.jar">
    <fileset dir="lib" includes="test/*.jar"/>
    <fileset dir="classes"/>
</jar>

Currently, something like that would be interpreted as packing given jar
files into the output file "as-is", without extracting their contents
and repacking them again.

Maybe some kinf of a flag on the taskitself or a portion of it would
help? Like this:

<jar combine="yes" jarfile="dist/combined.jar">

or

<fileset combine="yes" dir="lib" includes="test/*.jar"/>

I hope I am not the only one crazy enough to request such an insanity!
:)

--
Fyodor Golos
ResGen, Invitrogen Corporation
2130 Memorial Pkwy, SW
Huntsville, AL 35801
Phone: 800-533-4363
Direct: 256-327-4297
Fax: 256-536-9016




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


Re: combining contents of multiple jar files (and directories)

Posted by Peter Donald <do...@apache.org>.
On Sat, 3 Nov 2001 08:34, Fyodor Golos wrote:
> Peter Donald wrote:
> > On Sat, 3 Nov 2001 08:18, Fyodor Golos wrote:
> > > Is it possible to create one jar file containing contents of mutiple
> > > other jar files?
> >
> > what you want is jar task with a zipfileset. The zipfileset can include
> > files from another zip/jar file ;)
>
> Thanks, Pete! But don't I have to spell every single jar file that I want
> combined? 

yep

-- 
Cheers,

Pete

-----------------------------------------------------------
 Don't take life too seriously -- 
                          you'll never get out of it alive.
-----------------------------------------------------------

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


Re: combining contents of multiple jar files (and directories)

Posted by Fyodor Golos <fe...@resgen.com>.
Peter Donald wrote:

> On Sat, 3 Nov 2001 08:18, Fyodor Golos wrote:
> > Is it possible to create one jar file containing contents of mutiple
> > other jar files?
>
> what you want is jar task with a zipfileset. The zipfileset can include files
> from another zip/jar file ;)

Thanks, Pete! But don't I have to spell every single jar file that I want
combined? Like this:

<zip zipfile="dist/combined.zip">
    <zipfileset src="lib/one.zip">
    <zipfileset src="lib/two.zip">
    <zipfileset src="lib/one.zip">
    ...

Instead of this:

<zip zipfile="dist/combined.zip">
    <zipfileset src="lib/*.zip">
    ...

To be honest, this smells like potential maintenance problem.

Please correct me if I am wrong - you will make me happy!

--
Fyodor Golos
ResGen, Invitrogen Corporation
2130 Memorial Pkwy, SW
Huntsville, AL 35801
Phone: 800-533-4363
Direct: 256-327-4297
Fax: 256-536-9016




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


Re: combining contents of multiple jar files (and directories)

Posted by Peter Donald <do...@apache.org>.
On Sat, 3 Nov 2001 08:18, Fyodor Golos wrote:
> Is it possible to create one jar file containing contents of mutiple
> other jar files? I can currently achieve such behavior with optional
> task jlink. However, jlink has multiple limitations and annoyances.
>
> First of all, it does not check whether only a subset of files needs to
> be updated. It goes through the whole process every single time. Zip
> task, for example, can save me a huge amount of time by not executing
> anything at all if nothing has changed.
>
> Secondly, I would love to use filesets to provide a list of jar files to
> combine. For example:
>
> <jar jarfile="dist/combined.jar">
>     <fileset dir="lib" includes="test/*.jar"/>
>     <fileset dir="classes"/>
> </jar>

what you want is jar task with a zipfileset. The zipfileset can include files 
from another zip/jar file ;)

-- 
Cheers,

Pete

----------------------------------------------
Money is how people with no talent keep score.
----------------------------------------------

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