Maven shade jar throw exception

后端 未结 3 829
小鲜肉
小鲜肉 2020-12-06 02:02

I have the following Exception:

Exception in thread \"main\" java.lang.SecurityException: no manifiest section for signature file entry javax

3条回答
  •  误落风尘
    2020-12-06 02:46

    The SecurityException comes up because one of your dependencies is a signed jar. As the shade plugin is repacking this jar, it gets invalid. -> SecurityException at launch

    To solve the problem, you have to unsign the dependency jars while repacking them. This can be done by simply not repacking the files that make the jar signed, using a filter:

    
        org.apache.maven.plugins
        maven-shade-plugin
        1.5
        
            
                stand-alone
                package
                
                    shade
                
                
                    true
                    stand-alone
                    
                        
                            
                            *:*
                            
                                META-INF/*.SF
                                META-INF/*.RSA
                                META-INF/*.INF 
                            
                        
                    
                
            
        
    
    

    This solution was extracted from here: https://issues.apache.org/jira/browse/MSHADE-61

提交回复
热议问题