标签:meta 路径 ges ack 项目启动 apach pre 出错 uri
当项目依赖其他jar包的时候,打出的jar包执行出错,抛出标题中的异常。
原因:因为依赖jar包中的META-INF中有多余的.SF文件与当前jar包冲突。
maven项目在pom.xml文件:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>[mvean项目启动类的路径,例如:com.alarm.mainclass]</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build>
在打完的jar包执行 zip -d your.jar ‘META-INF/.SF‘ ‘META-INF/.RSA‘ ‘META-INF/*SF‘
参考链接:
1.https://www.jianshu.com/p/cd1f1b33a41a
2.https://blog.csdn.net/tian_shi_hei_de/article/details/78490392
解决java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
标签:meta 路径 ges ack 项目启动 apach pre 出错 uri
原文地址:https://www.cnblogs.com/chenmingming0225/p/13204247.html