问题
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