Maven Surefire for Integration Tests in JUnit
Maven surefire plugin is used to run unit tests during test phase of build lifecycle . The reports are generated in .txt or .xml file. These files are generated at ${basedir}/target/surefire-reports
Surefire runs unit tests during build phase, not integration tests which are executed during package phase. But you can include integration tests also to be run
Below is the configuration for surefire plugin in your pom.xml
<profile>
<id>itest</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.report.version}</version>
<configuration>
<includes>
<include>**/*IntTest.java</include>
<include>**/*IntTests.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>



What nonsense. The failsafe-plugin makes this better.