Valid JAR signature for JavaFX projects

前端 未结 2 1448
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:27

    After a lot of research I found a solution that works for my project using JavaFX, Maven and NetBeans.

    I'm working on a simple REST client that uses jersey and moxy to decode JSON. After adding the dependency jersey-media-moxy application reports the error of invalid signature.

    I found that this depends on the presence of the signature file ECLIPSE_.RSA and ECLIPSE_.SF inside the META-INF for some libraries. In my case were the org.eclipse.persistence.moxy-2.5.0.jar, org.eclipse.persistence.antlr-2.5.0.jar, org.eclipse.persistence.asm-2.5.0.jar and org.eclipse.persistence.core-2.5.0.jar

    The pom.xml in Netbeans that you indicated running two separate step. The first invoke maven-dependency-plugin that expands all the external jar. The second use exec-maven-plugin that call javafxpackager to create the final jar file e finally run it.

    By performing the two steps in sequence signature in org.eclipse libraries are placed in the META-INF of the final jar file and this generates the error on the signature.

    My solution is add an intermediate step between the execution of the maven-dependency-plugin and exec-maven-plugin. In this step I'm going to delete all signature file inside the directory

    ${project.build.directory}/classes
    

    To do this I used a plugin maven-antrun-plugin

    
        maven-antrun-plugin
        1.8
        
             
                  package
                  
                       run
                  
                  
                       
                           
                               
                               
                               
                        
                    
                
            
        
    
    

提交回复
热议问题