If you use Maven (recommended), put your Spring configuration files in the standard location src/main/resources (and src/test/resources for any configuration specific to the test), then during the assembly these files will be copied to the target/classes directory .
You can reference them in your @ContextConfiguration simply:
@ContextConfiguration(locations = { "/applicationContext.xml", "/applicationContext-test.xml"})
If you're not using Maven, I still recommend using the Standard Catalog Layout for the source and artifacts and make your (supposedly Ant based) build process the same way.
source share