Application context from another maven module cannot be loaded

I have a project with several maven modules, where each maven module has its own application context in src/main/resources . One of these multi-module projects is a web application, and the application application context is the import of application contexts of other maven modules. I am using a similar pom configuration as mentioned in this link.

My problem is that the web application application context cannot load application contexts of other maven, jars modules. I think this should be somehow possible, but I cannot understand it. I reviewed the application import command with or without regex, but was not successful.

I would be very grateful if you explain the above problem in the light of an example.

+3
source share
1 answer

I do this all the time in Maven multi-module projects, exactly as you describe. Just use for example

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

in the context of your webapps application, and this imports the entire Spring configuration into /META-INF/spring in all its dependent modules. If not, maybe the corresponding modules are not declared as webapp dependencies?

+1
source

All Articles