You can use the context file of the main test application, which includes only a specific context file, using Maven resource filtering
eg.
@ContextConfiguration("classpath:test-context.xml")
where src/main/resources/test-context.xml :
<beans> <import resource="${project.test.context}" /> </beans>
Then run mvn test -Dproject.test.context=context1.xml , mvn test -Dproject.test.context=context2.xml , etc.
If you do this, you should also set the default maven property project.test.context in your POM.
By the way, if these are integration tests, they should be conditionally called ... IT.java, not ... Test.java, and should be performed using fail-safe (using mvn verify ), and not surefire.
source share