title: Run Spring MVC webapp with different configuration during integration tests
body: <p>I'm using the <code>maven-jetty-plugin</code> to run my Spring MVC webapp during the <code>integration-test</code> phase of a Maven build, and run various tests on it. At this point, I'd like to be able to switch out some of the Spring configuration, so that I can point at a different bean implementation during the integration tests. This is so that I can change which database to run against, rather than use the production connection settings.</p>
  
  <p>What sort of approach should I consider? Should I attempt to use resource filtering on the servlet-context.xml file? Should I have two different configuration files? How do I get this to play nicely with the Jetty plugin?</p>
  
  <p><strong>EDIT</strong>: I'm considering using Spring's Java-based <code>@Configuration</code> annotations in preference to the XML servlet-context file, and switching what sort of beans I construct based on environment variables or similar, but this feels wrong as well.</p>