Since the last Java update, I need to tag my applet jars manifest with the Trusted-Library
attribute to avoid warning popup when javascript is communicating with the applet. (see http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mixed_code.html)
Manifest-Version: 1.0
Trusted-Library: true
Created-By: 1.6.0-internal (Sun Microsystems Inc.)
I never done such things before, is there a plugin which allow to do that in a seamless way or should I write one, or use the ant plugin?
The jars are already assembled and available through dependencies, copied in the target folder to be signed during the packaging. I'm using Maven 3
As of today I needed to add some manifest attributes for signed Java applet. I found it very straightforward with maven-jar-plugin. Just put required attributes to src/main/resources/META-INF/MANIFEST.MF:
Then just configure maven-jar-plugin plugin:
And the result was:
I consider usage of webstart-maven-plugin the right choice here. I mean there are bugs, there are things that you might need to patch yourself, but if you're OK with that, the one plugin can do quite much for you without some ant workarounds.
For the particular problem there is a bug report with a working patch included. See: http://jira.codehaus.org/browse/MWEBSTART-213
UPDATE:
fix is included in the release:
1.0-beta-4
.going for configuration:
should do the job
In the end I just used the antrun plugin like the following, antcontrib is used to loop over the list of jars:
build-trusted.xml
In the pom
You can do that with the Maven JAR Plugin during the creation of the JAR file. Add the following to your
pom.xml
:The main attributes as specified in the JAR File Specification are available as dedicated elements, e.g.:
See the Maven Archiver Reference for further information.
To modify the manifest inside an existing jar file create a text file, e.g.
mymanifest.mf
which contains the required properties:You can add the attributes of this file to an existing jar by executing the following command:
This will modify the
manifest.mf
inside the given jar.