Since the latest java release (7u45), I'm getting tons of errors on third part jar libraries that my webstart application uses, due to newly required manifest attributes being missing:
Missing Application-Name: manifest attribute for: http://site/lib/jh.jar
Missing Permissions manifest attribute for: http://site/lib/jh.jar
Missing Codebase manifest attribute for: http://lib/jh.jar
So, I need to run a batch ant task to update the manifest files in each of the 30 or so required libraries before I can use them for distribution.
How can I do this in ant? (preferably without ant-contrib)
PS: I've already fixed all the other 7u45 update crap (code signing, JNLP attribs, etc).
To modify the manifest, you must first prepare a text file containing the information you wish to add to the manifest. You then use the Jar tool's m option to add the information in your file to the manifest. Warning: The text file from which you are creating the manifest must end with a new line or carriage return.
The manifest file is named MANIFEST. MF and is located under the META-INF directory in the JAR. It's simply a list of key and value pairs, called headers or attributes, grouped into sections.
Testing manifest updates # Plug in the device and ensure it's connected to WiFi. Use the Android task manager to shut down the PWA, then use the App panel in Android settings to force stop the PWA. In Chrome, open about://webapks and click the "Update" button for the PWA. "Update Status" should change to "Pending".
Try something like this.
<for param="jarFile">
<fileset dir="${webapp.dir}">
<include name="*.jar"/>
</fileset>
<sequential>
<jar update="true" file="@{jarFile}">
<manifest>
<attribute name="Application-Name" value="ABCDEF"/>
<attribute name="Codebase" value="*"/>
<attribute name="Permissions" value="all-permissions"/>
</manifest>
</jar>
</sequential>
</for>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With