在单个应用程序中有两个版本的Spring Framework? [英] Two versions of Spring Framework in a single app?
问题描述
我正在使用Spring v3开发我的应用程序.现在,我包括了另一个模块(使用Maven),该模块又依赖于Spring v4.虽然我的应用程序和此模块可以正常运行,但如果分别启动,则合作会失败.
I am developing my app, using Spring v3. Now I have included another module (using Maven), which, in turn, depends on Spring v4. While my app and this module work perfectly fine, when booted separately, cooperation just fails.
是否可以将我的应用程序与此模块组合在一起,从而将两个不同版本的Spring捆绑到结果应用程序中?
Is it possible to combine my app with this module somehow, resulting in two different version of Spring bundled into resulting app?
推荐答案
OSGi
是隔离您classloader
并允许在一个应用程序中使用同一库的不同版本的一种选择.您可以在
OSGi
is one alternative to isolate you classloader
and allow use different versions of the same library in one application. You can start learning it on this article.
这篇关于在单个应用程序中有两个版本的Spring Framework?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!