I have two spring projects. Both are currently portlets.
I would like to take one and convert it to a jar and add it as a dependancy (using maven) to the other then call the code)
Any advice on the steps would be great.
I have tried and although everything (inc context) gets packaged in my jar , it appears when calling classes from within the portlet consuming the jar the application context is not loaded/working
Current jar structure
application-context.xml
META-INF/
<package>/classes
EDIT__
Re errors: Cannot Find Bean Definition for class x
There are a couple of ways to do this but it highly depends on what you are trying to do. You can include the context in your web.xml…
Another option is to import the child context directly from your application context.
I’m not an overly big fan of this since these contexts get merged which can be a nightmare for bean names; however, they do work.
It’s usually better that your JAR exposes some sort of factory or static constructor that reads it’s own Spring config XML and then simply exposes what you want to use as a service. This might not be the best solution for your particular problem but it is something to consider.