Init spring across multiple modules
Hi,
I'm new to spring + maven and although I know a fair bit about them now, I'm getting stuck. I'm writing an application that has many modules, and depending on what functionality is required, some modules may or may not be included.
Each one of my modules defines a spring xml configuration file full of beans, but I am unsure how to load this from the core of the app.
My first attempt (which works) is in the maven build, pull out all spring files into a directory. Then in the code I can just load the directory. Although this works, it means the artifact I publish for each module has to be a tar.gz of file + random resources, and not just a jar file.
Ideally I'd like the spring config in the jar file, but I am unsure how to load all config over say, 10 modules / different jars. I'd ideally have these in their seperate module jars / not combine them into an uber jar.
Only way I can think of atm is inspecting the jars and pulling out the spring config files.
Is there a better way of doing this in spring, or maybe theres a more "spring like" approach to the structure of my project that I do not understand / am missing.
Some help would be greatly appreciated,
Thanks, Jon.