简体   繁体   English

一个应用程序中有两个版本的 Spring Framework?

[英]Two versions of Spring Framework in a single app?

I am developing my app, using Spring v3.我正在使用 Spring v3 开发我的应用程序。 Now I have included another module (using Maven), which, in turn, depends on Spring v4.现在我已经包含了另一个模块(使用 Maven),它又依赖于 Spring v4。 While my app and this module work perfectly fine, when booted separately, cooperation just fails.虽然我的应用程序和这个模块工作得很好,但单独启动时,合作就会失败。

Is it possible to combine my app with this module somehow, resulting in two different version of Spring bundled into resulting app?是否有可能以某种方式将我的应用程序与此模块结合起来,从而将两个不同版本的 Spring 捆绑到生成的应用程序中?

OSGi is one alternative to isolate you classloader and allow use different versions of the same library in one application. OSGi是隔离classloader并允许在一个应用程序中使用同一库的不同版本的一种替代方法。 You can start learning it on this article .您可以从这篇文章开始学习。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM