2

My main problem is I have to sign all the JARs of WEB-INF\lib folder.

So this is what I have done:-

  • Enabled archiveClasses option to package classes also into JAR
  • Added JAR-Signer Plugin and setting the archive directory to ${project.build.directory}\${project.build.finalName}\WEB-INF\lib

After package finishes, I can check that in target directory all JARs in lib folder are signed but my war file contains unsigned JAR only. Most probably because the jar-signer executed after maven-war-plugin has created the war file. I tried with setting JAR-Signer to pre-package phase also, but the lib folder is not present by then.

So what I need is to execute Maven JAR-Signer just before maven creates the war file from target directory.

Thanks

kleash
  • 1,211
  • 1
  • 12
  • 31
  • Just an idea to try: put `maven-jarsigner-plugin` below `maven-jar-plugin` and above `maven-war-plugin` in `pom.xml`. The phase should be `package`. – ZhekaKozlov Nov 09 '17 at 12:38
  • I ended up creating my own custom soultion to unpack war, sign dependencies and pack it again.. – kleash Nov 10 '17 at 06:31
  • Hi @kleash, Can please share your solution for signing of Jar files by unpacking and packing war, using maven Jar-Signer. Many thanks in advance!!!! – arjun99 Mar 10 '21 at 08:03
  • hi @arjun99 sorry it's an old post. I no longer have that code with me – kleash Mar 10 '21 at 09:33

0 Answers0