We have a hundreds of tests defined for our integration-test phase lifecycle in maven, and they take a long time to finish.
What I want to do is run just one test in
I struggled through this, and I created an additional profile to use when I wanted to run just one integration test. I hope that I've successfully extracted just the right part here:
integrationTestSingle
maven-surefire-plugin
surefire-it
integration-test
test
**/integration/**/${test}.java
false
-Xms256M -Xmx768M -XX:MaxPermSize=256M
maven-surefire-plugin
default-test
true
Now, I call maven with the integrationTestSingle profile and with -DfailIfNoTests=false -Dtest=NameOfTest, and it doesn't run any of the regular tests during the regular "test" phase, and runs just the NameOfTest test during the integration-test phase.