Peter,
I'd welcome you to CodeRanch, but you've been a member a long time. So congrats on your first post!
The crux of the problem is that "classpath:/spring/main.xml" and "classpath:/spring/test-override.xml" are hardcoded. For the main.xml, you are already instantiating in Java code. You can change the Java code to get the value from a property file, system property, etc and point to any file you want. For the test-override one, you can still change the xml to refer to a value that comes from a property file. If you host that property file outside your jar, you make it easy to change.
I was tempted to say that ccould create an
@Configuration class.
But this doesn't work because you'd need to know the name of the resource at compile time since it is in an annotation.