maven bouncycastle jar java.lang.SecurityException
程序员文章站
2022-07-13 10:36:46
...
用maven-shade-plugin 打包可运行jar,但因引用了bouncycastle 相关jar,打包出来的jar 运行后出现异常“java.lang.SecurityException: no manifest section for signature file entry”
网上google很久,才发现因bouncycastle相关的jar 原因,使用一般的maven-shad-plugin配置不可用,需修改新增如下:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>${maven.shade.plugin.version}</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <!-- because no manifest section for signature file entry --> <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>com.csair.jar.Provider</mainClass> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.handlers</resource> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.schemas</resource> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build>
原文来自:
http://www.jamesswafford.com/2012/03/11/java-lang-securityexception-no-manifest-section-for-signature-file-entry/
上一篇: maven bouncycastle jar java.lang.SecurityException
下一篇: 使用maven-shade 打包apache cxf 为可运行包 出现异常Caused by: org.apache.cxf.BusException:
推荐阅读
-
MyEclipse怎么修改Maven的Jar库地址?
-
详解IDEA中MAVEN项目打JAR包的简单方法
-
详解idea maven项目如何使用lib下得jar包
-
idea查找关键字快捷键(maven项目自动导入jar包)
-
maven下载jar包改用阿里云maven库的方法
-
使用IDEA的maven工程导入ojdbc14 jar包失败
-
idea查找关键字快捷键(maven项目自动导入jar包)
-
Spring Boot Maven 打包可执行Jar文件的实现方法
-
Nexus-在项目中使用Maven私服,Deploy到私服、上传第三方jar包、在项目中使用私服jar包
-
maven下载jar包改用阿里云maven库的方法