Rehman
Rehman

Reputation: 3998

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.

Upvotes: 3

Views: 9286

Answers (1)

ryanp
ryanp

Reputation: 5127

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?

Upvotes: 1

Related Questions