I have a project that exposes a bean to client apps. I'd like to drop a jar onto my classpath and have my project <import> a Spring config contained in that jar. It appears that Spring can't find the config file in the jar as I get the exception:
The dependancy jar file is structured:
My project's jar is structured:
MySpringConfig.xml contains a line like:
If I place the META-INF (but not the .class files) from the xyz-service jar into the myproject jar everything works fine, so I suspect that Spring does not <import> across jar files. Is this true? Is there a way around it?
java.io.FileNotFoundException: class path resource [META-INF/myproject/../com/xyz/Service.xml] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:160) ...
xyz-service-1.0.jar /META-INF /com /xyz Service.xml /com /...
myproject-1.0.jar /META-INF /myproject MySpringConfig.xml /com /...