Valid JAR signature for JavaFX projects

前端 未结 2 1450
Happy的楠姐
Happy的楠姐 2020-11-27 06:47

I\'ve been working through various recipes to produce a runnable JAR file for a JavaFX project using a Maven POM. Each of these Stackoverflow questions des

2条回答
  •  广开言路
    2020-11-27 07:41

    I had a very similar problem; when I included a signed JAR (bouncycastle) in the project. Its signature was repackaged verbatim, resulting in an obvious SecurityException:

    java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

    Filtering of all sorts failed; the solution that works for me looks like this in the pom.xml:

    
      org.apache.maven.plugins
      maven-dependency-plugin
      2.8
      
        
          unpack-dependencies
          package
          
            unpack-dependencies
          
          
            META-INF/*.SF,META-INF/*.DSA,META-INF/*.RSA
            ...
          
        
      
    
    

    I omitted some lines after the new one with the "excludes" pattern. This single line was the solution for me - I include the other lines so you can see the placement. (I had trouble with many other postings which omitted the context of a tag, so I try to save others this trouble).

    Hope that helps others with the same problem.

提交回复
热议问题