Is it possible to build a spring application jar file /w all jar dependencies packaged inside the jar as usual, but resources folder + spring app-context.xml defined outside the jar? If so can anyone point me to an example?
I want to build using maven, if possible, but maven squishes resources to the root of jar and i want those available/captured externally, so I guess there are actually 2 questions here.
- How do you make spring consume context/properties from external files. (ex. external "classpath*:/META-INF/spring/applicationContext.xml")
- How do you make maven package the jar file, NOT squishing resources to main jar. Though I guess this could be configured via a maven plug-in... I guess the first question is more important, I just figured there was some sort of a template solution for this, but have not been able to find an example.
src/main/resources
. Something like/META-INF/spring/applicationContext.xml
is still on the classpath. – Sotirios DelimanolisFileSystemXmlApplicationContext
– Sotirios Delimanolisfolder/myawesome.jar
i also havefolder/config/*
with all the spring resources and configs next to it. Is it amazing how many java programmers don't understand the basics of classloading? Some kids never take training wheels off their bikes :) – niken