0

Here is my plugin configuration from pom.xml file

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.19.1</version>
    <executions>
      <execution>
        <id>run-unit-tests</id>
        <phase>test</phase>
        <goals>
          <goal>test</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <skipITs>true</skipITs>
      <skipUTs>false</skipUTs>
    </configuration>
  </plugin>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.19.1</version>
    <executions>
      <execution>
        <id>run-integration-tests</id>
        <phase>integration-test</phase>
        <goals>
          <goal>integration-test</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <skipITs>false</skipITs>
      <skipUTs>false</skipUTs>
    </configuration>
  </plugin>

I have 2 test classes HelloTest.java and WorldITest.java.

When I run mvn clean test i want it to execute only HelloTest. But when i execute mvn clean integration-test, then I want both HelloTest and WorldITest to be executed.

But the problem is that it executes the Integration test also in mvn clean test command.

PS: Original code was taken from the discussion : Prevent unit tests in maven but allow integration tests

Community
  • 1
  • 1
dinesh707
  • 12,106
  • 22
  • 84
  • 134
  • Your ITs are not correctly named, should be `WorldIT`. See http://stackoverflow.com/a/37999965/1743880 and http://stackoverflow.com/a/5090311/1743880 – Tunaki Oct 21 '16 at 09:33
  • @Tunaki thanks. That was the issue. You can add it as an answer. – dinesh707 Oct 21 '16 at 09:36
  • Possible duplicate of [How do I get my Maven Integration tests to run](http://stackoverflow.com/questions/1399240/how-do-i-get-my-maven-integration-tests-to-run) – Tunaki Oct 21 '16 at 09:40

0 Answers0