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

半世苍凉 提交于 2019-12-05 00:53:20

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.

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

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

I haven't tried it.

<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>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!