I have created a Jar Project which contains Filter
.
I need to use servlet-api.jar
when I compile the Filter
code.
But when I want to use the Jar in another application, I want to build the jar in such a way that it will exclude servlet-api.jar
.
I am using Apache Ant with NetBeans 8:
I have added below code in build.xml
.
<target name="-post-jar">
<jar destfile="dist/MyJar.jar">
<zipfileset src="dist/MyJarAsLibrary.jar"/>
<zipgroupfileset dir="dist/lib/." excludes="javax/*"/>
</jar>
</target>
I have used Apache Ant zipgroupfileset.
But I searched on google I found the excludes for files.
I tried with excluding the servlet packages as javax/*
, but it did not work.
No Idea how to exclude specific packages.
I found few excludes with zipfileset
, but I need to use zipgroupfileset
and exclude the javax.servelt.*
packages.