maven-shade-plugin打Jar包的相关问题

来源:互联网 发布:足球淘汰赛算法 编辑:程序博客网 时间:2024/05/21 19:42



问题如下:

问题1:使用maven-shade-plugin插件,打超级JAR包时,运行maven install出错如下。
Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade (default) on project QMServer: Execution default of goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade failed: A required class was missing while executing org.apache.maven.plugins:maven-shade-plugin:2.0:shade: org/sonatype/aether/graph/DependencyNode

解决方法:调整eclipse中的就JRE即可.




问题2:Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

解决方法:由于某些包的重复引用,以至于打包之后的META-INF的目录下多出了一些*.SF,*.DSA,*.RSA文件所致

(据说解压jar包,然后删掉这些文件再次打包错误就会消失,未确认),再次修改pom.xml。加入
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                </excludes>
                            </filter>
                        </filters>










1 0
原创粉丝点击