Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven-failsafe-plugin is not executing my integration tests

Bellow a part of my actual pom. Testng tests for integration tests have been assigned a "integration" group in the @Test annotations. To do little test I did not exclude the "integration" group during the test phase.

When building using for example mvn verify or mvn install the integration tests get executed in the test phase, but not the verify or integration-test phase. The number of tests run remains 0. Somehow they are not picked up. Anyone have an idea on what might be wrong?

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.12.1</version>
    <configuration>
      <skip>false</skip>
    </configuration>
  </plugin>
  <plugin>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.12.1</version>
    <executions>
      <execution>
        <id>integration-test</id>
        <phase>integration-test</phase>
        <goals>
          <goal>integration-test</goal>
        </goals>
        <configuration>
          <skip>false</skip>
          <excludedGroups>unit</excludedGroups>
        </configuration>
      </execution>
      <execution>
        <id>verify</id>
        <phase>verify</phase>
        <goals>
          <goal>verify</goal>
        </goals>
        <configuration>
          <skip>false</skip>
          <excludedGroups>unit</excludedGroups>
        </configuration>
      </execution>
    </executions>
    <configuration>
      <skip>false</skip>
      <excludedGroups>unit</excludedGroups>
    </configuration>
  </plugin>

Update: Adding TestNG as a dependency to the failsafe plugin does not help

like image 742
Peter De Winter Avatar asked Dec 20 '25 11:12

Peter De Winter


1 Answers

maven-failsafe-plugin by default includes only files matching following patterns:

<includes>
 <include>**/IT*.java</include>
 <include>**/*IT.java</include>
 <include>**/*ITCase.java</include>
</includes>

How did you name your test class(es)?

like image 199
Marcin Zajączkowski Avatar answered Dec 23 '25 17:12

Marcin Zajączkowski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!