![](/img/trans.png)
[英]Multi-module IntelliJ project with maven - How to add dependencies from one module to another?
[英]In a maven multi-module project, how to access the spring beans from one module to another
我有一個Maven多模塊應用程序,如下所示
parent
-+ module 1
-+ module 2
-+ module 3
模塊2和模塊3是獨立的jar,並作為模塊1的依賴添加。
所有模塊都分配有應用程序上下文。
我需要將彈簧豆從模塊3和模塊2移至模塊1。
請幫忙
如果您將spring與xml配置文件一起使用,則應在模塊1的應用程序上下文中導入模塊2和模塊3的應用程序上下文文件,如下所示:
<import resource="classpath*:file/location/module1application-context.xml" />
<import resource="classpath*:file/location/module2application-context.xml" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.