Including Signed Libraries in Executable JAR with Maven

时光毁灭记忆、已成空白 提交于 2019-12-25 09:31:50

问题


Maven shade and assembly plugins first unpack and then add dependencies to the executable jar. This can produce a conflict with Java Cryptography Extension, since the libraries like BouncyCastle should be used in their signed versions.

Question: Is there a way to create executable jar with maven in a way that the libraries are included without unpacking?


回答1:


The standard classloader will not load classes from another jar, hence the exploded jar. The best way to achieve adding the signed jars is using the -cp command, something like :

java -cp signedjar;shadepluginjar Main


来源:https://stackoverflow.com/questions/46849610/including-signed-libraries-in-executable-jar-with-maven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!