Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application context from other maven module cannot be loaded

I have multi module maven project where each maven module has its own application context under src/main/resources. One of these multi module project is web application and application context of the application is importing application contexts of other maven modules. I am using similar pom configuration as it is mentioned in this link.

My Problem is, application context of web application is unable to load application contexts of other maven modules, jars. I think it should be some how possible but i am unable to figure it. I have reconsidered application importing command with or without regex, but no success.

I would be highly thankful if you explain the aforementioned problem in light of an example.

like image 475
Rehman Avatar asked Feb 14 '26 13:02

Rehman


1 Answers

I do this all the time in multi-module Maven projects exactly as you describe. Just have e.g.

<import resource="classpath*:/META-INF/spring/*.xml" />

in your webapps's application context and this will import all the Spring configuration under /META-INF/spring in all of its dependent modules. If not, maybe the modules concerned aren't declared as dependencies of the webapp?

like image 117
ryanp Avatar answered Feb 17 '26 03:02

ryanp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!