Extending spring based app

Posted by pitr on Stack Overflow See other posts from Stack Overflow or by pitr
Published on 2010-03-24T21:42:06Z Indexed on 2010/03/25 7:43 UTC
Read the original article Hit count: 460

Filed under:
|
|
|

I have a spring-based Web Service. I now want to build a sort of plugin for it that extends it with beans. What I have now in web.xml is:

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/classes/*-configuration.xml</param-value>
</context-param>

My core app has main-configuration.xml which declares its beans. My plugin app has plugin-configuration.xml which declares additional beans. Now when I deploy, my build deploys plugin.jar into /WEB-INF/lib/ and copies plugin-configuration.xml into /WEB-INF/classes/ all under main.war.

This is all fine (although I think there could be a better solution), but when I develop the plugin, I don't want to have two projects in Eclipse with dependencies. I wish to have main.jar that I include as a library. However, web.xml from main.jar isn't automatically discovered. How can I do this? Bean injection? Bean discovery of some sort? Something else?

Note: I expect to have multiple different plugins in production, but development of each of them will be against pure main.jar

Thank you.

© Stack Overflow or respective owner

Related posts about java

Related posts about spring