0

I am using "org.eclipse.jgit-6.4.0.202211300538-r.jar" in a java project with maven. When I run the program from Intellij everything is fine and the program works perfectly. When I build an Artifact out of this project and run it on command line I get the error "java.lang.SecurityException: Invalid signature file digest for Manifest main attributes".

I know this jar file is a signed jar so I copied the JAR file to another directory and extracted it and deleted the *.RSA and *.SF files and ran it, doesn't work. I also extended my pom.xml file with all the suggestions found online like "excludes", "plugins" and much more, still doesn't work. May be you guys from StackOverflow know how can I create a single JAR-file which uses this jar and doesn't give the error. So how to get rid of this security error which does NOT come out when I run the program in Intellij but appears when I run it on a command line with java -jar

Ali Tc
  • 1
  • 1
  • You can try to create a JAR with excluded files via 'maven-shade-plugin' as described https://stackoverflow.com/a/6743609/12844632 – Egor Klepikov Apr 19 '23 at 11:23
  • Thanks for the reply. I added the configuration to the pom.xml file right after block like this: org.apache.maven.plugins maven-shade-plugin 3.4.1 package shade ----- the configuration block ----- Then I built the Artifact from Intellij and then "java -jar MyApp.jar". Unfortunately it does not work. – Ali Tc Apr 20 '23 at 05:33

0 Answers0