Including Signed Libraries in Executable JAR with

2019-08-16 11:27发布

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条回答
戒情不戒烟
2楼-- · 2019-08-16 11:53

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
查看更多
登录 后发表回答