Integration testing with Maven

If you need to run integration tests with Maven, check out FailSafe maven plug-in ( It assumes that your integration tests are in the same directory as unit tests, but are named * The reason you want to separate the integration tests execution from unit test integration tests, is because the integration tests take much longer and might have to have some setup before they are run and tear down after they are run.  You don’t want to run the integration tests all the time – it’s too expensive, but you do want to run them before developer checks in the code and (at least) for continuous build environment. To skip the integration tests you can use the following command:

mvn install -DskipITs

When using it, you will most probably get the following error:
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
To avoid this error add the following property in the properties part of pom.xm (after build as described by

One more thing – I had problems by just putting -DskipITs=true, since the plug-in code did not check for it. So I used the following plugin configuration note the skipITs:



Leave a Reply

You must be logged in to post a comment.