I have developed sample api as jar file. This jar file contains the code which is common to 10 different application, so all these apps has to do is include this jar file. Now this jar file uses spring and jndi datasource. When I used this jar in one of the spring mvc application as dependency, then it is not finding the jndi datasource bean defined in one of the context file inside the jar file. How can I tell spring container to scan all the application context files in the jar.
There are other web application which is not spring mvc and they also use the same jar file as dependency, how can they use this spring based jar file.
Thanks
You should add the application context file of your jar in the Web of your applications, for exmple:
You can use also something like library-context*.xml in order to import few context files but I think it is better doing it one by one so you konw exactly what context files you are using.
If you have applications that are not using Spring MVC, it is not a problem since you don’t need Spring MVC, just Spring IoC