I\'ve combed StackOverflow and many other sites, have found many other related posts and have followed all said suggestions, but in the end, failsafe is skipping my
For me, surefire:verify
did not run any tests.
I had to use surefire:integration-test
.
Your tests are not in the default test sources directory src/test/java. See:
https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
myModule/src/main/test/java/ClientAccessIT.java
should be:
myModule/src/test/java/ClientAccessIT.java
You could also update your pom file (if you really wanted tests to live in main) to include:
<build>
<testSources>
<testSource>
<directory>src/main/test</directory>
</testSource>
</testSources>
</build>
I'm using java 8, failsafe plugin version 2.22.2 => tests not running problem, to solve this I added next:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire.plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.22.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>integration</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
You need to rename your test class.
You can find the names the plugin looks for by default in the documentation, as pointed out by @acdcjunior:
By default, the Failsafe Plugin will automatically include all test classes with the following wildcard patterns:
- "
**/IT*.java
" - includes all of its subdirectories and all java filenames that start with "IT".- "
**/*IT.java
" - includes all of its subdirectories and all java filenames that end with "IT".- "
**/*ITCase.java
" - includes all of its subdirectories and all java filenames that end with "ITCase".