sofastack / sofa-ark

SOFAArk is a light-weight,java based classloader isolation framework.
https://www.sofastack.tech/projects/sofa-boot/sofa-ark-readme/
Apache License 2.0
1.57k stars 500 forks source link

How to not package the lib directory into the jar package when the biz package is packaged, and load the external lib directory when running? #336

Closed dxp909 closed 4 years ago

dxp909 commented 4 years ago

Your question

biz包打包时如何不把lib目录打包到jar包里,运行时加载外部lib目录?

Your scenes

项目里需要把多个工程打包成biz包,然后合并部署,打包成biz包后第三方依赖会放到lib目录下打包到biz包中,biz工程外部依赖都一样,如何把这些依赖实现共享?

Your advice

describe the advice or solution you'd like

Environment

sofastack-bot[bot] commented 4 years ago

Hi @dxp909, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

Your question How do you not package the lib directory into the jar package when you package the biz package, and load the external lib directory when running? ### Your scenes In the project, multiple projects need to be packaged into a biz package, and then combined and deployed. After packaging into a biz package, third-party dependencies are placed in the lib directory and packaged into a biz package. The external dependencies of the biz project are the same. Are these dependencies shared? ### Your advice describe the advice or solution you'd like ### Environment-SOFAArk version:-JVM version (eg java -version):-OS version (eguname -a):-Maven version: -IDE version:

glmapper commented 4 years ago

@dxp909 可以通过classloaderhook 机制使得所有子biz共享宿主biz中的依赖

dxp909 commented 4 years ago

好的,多谢 @glmapper