How can I use a zipfileset src attribute without having to specify it manually for all my jars?
Asked Answered
F

3

11

I currently have this:

<jarjar destfile="a.jar" manifest="Manifest.mf">
  <zipfileset src="first.jar"/>
  <zipfileset src="second.jar"/>
</jarjar>

The problem is I have to manually specify each jar, because I need the src parameter to be taken in consideration. I would want something like this:

<zipfileset>
   <include name="*.jar"/>
<zipfileset>

And have their contents extracted and included in my resulting archive. Is this possible?

Floorer answered 9/6, 2011 at 10:41 Comment(0)
I
14

Maybe you could merge the jars first with:

<zip destfile="out.jar">
  <zipgroupfileset dir="lib" includes="*.jar"/>
</zip>

and specify the merged jar in the zipfileset.

zipgroupfileset

A <zipgroupfileset> allows for multiple zip files to be merged into

the archive. Each file found in this fileset is added to the archive the same way that zipfileset src files are added.

<zipgroupfileset> is a fileset and supports all of its attributes and

nested elements.

Idiot answered 9/6, 2011 at 12:10 Comment(0)
G
5

According to comments on the jarjar wiki, you can use this in your jarjar:

<zipgroupfileset dir="lib" includes="*.jar" />

I haven't tried it.

Gracegraceful answered 9/6, 2011 at 12:21 Comment(0)
B
1
<jar destfile="./dist/Ohmyfish.jar" basedir="./bin">
    <manifest>
        <attribute name="Created-By" value="Bruce Yang" />
        <attribute name="Main-Class" value="org.bruce.ohmyfish.entry.Main" />
    </manifest>
    <zipgroupfileset dir="./libs" includes="**/*.jar" />
</jar>
Bedridden answered 17/2, 2013 at 2:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.