Search code examples
mavenintegration-testinglifecyclemaven-surefire-plugin

Changing when maven runs integration tests


We have unit tests (mockito) and integration tests (in-memory database) We'd like maven to not run the integration tests as part of 'mvn install'. Basically I think this means reconfiguring the lifecyle so that integration-test comes between install and deploy. Is this possible?

The reason for this would be that the integration tests are somewhat time consuming and so we don't want them to run every time a developer does an install. But we would like them to be run before the project can be released, for example.


Solution

  • Check the docs for the plugin you use for running integration tests (possibly Failsafe) - simply exclude the tests, or set the plugin execution to false.