Jarsigner manifest permissions

How can you add additional parameters to the jar manifest file when signing it? I have a javaws application that uses some external libraries. Starting with java7u25, additional parameters are required in the manifest (permissions and code base). How can I install them when signing (if possible with maven). I can set it during build for artifacts that I create, but for those that I get from external repositories, how can I insert them during signing?

+6
source share
3 answers

I update third-party banks before signing them. Ant task to update flag:

jar ufm thirdparty.jar manifest_adder.mf

  • u: update

  • f: output to file

  • m: attachment file.

The manifest_adder.mf file will be merged with the existing manifest in a third-party bank.

+3
source

Important Note:

Note. The contents of the manifest must be encoded in UTF8.

I lost a lot of time because of this. Hope this helps someone.

+2
source

I don't know about maven, but I recently researched this topic regarding adding the same attributes (the ones you mentioned) to third-party jars during build using ANT . The Java procedure creates another manifest file (containing the new attributes) and adds it with the jar manifest. You can check the command here , I created my cans during assembly, so I had two options:

First: 1) Unpack the jar 2) Change the manifest 3) Create a Jar again

but it was rather cumbersome, so I used exec() task ANT to run the command to merge the two manifest.

Hope this solves your problem. Thanks

+1
source

Source: https://habr.com/ru/post/948204/


All Articles