I need to unzip multiple jars in my folder and add some entry in Manifest.MF and have to zip the jars again indivudually. I dont need a combined jar. But I need indivudal jars with new Manifest entries. How can i do it using ant script? Is there any way to do it.
For eg. I have two jar files in my location say test1.jar, test2.jar
So if i am unzipping with this code
<jar destfile="test1.jar">
<fileset dir="build/main/classes"/>
<zipfileset includes="**/*.class" src="lib/main/test.jar"/>
<manifest>
<attribute name="permission" value="all-permissions"/>
</manifest>
</jar>
and again If I am going to zip it
<zip destfile="test1.jar">
<zipfileset src="test.jar">
<exclude name="do/not/include/this/class"/>
</zipfileset>
</zip>
In this case for the processing of test2.jar, i have to repeat the above script again in my build.xml
But I need to do it generically, so that it can pick up both my jar files and add the manifest property and create two jars in the same name as test1.jar and test2.jar.
Something like:
<jar destfile="*.jar">
<fileset dir="build/main/classes"/>
<zipfileset includes="**/*.class" src="lib/main/test.jar"/>
<manifest>
<attribute name="permission" value="all-permissions"/>
</manifest>
</jar>