Thứ Sáu, 13 tháng 11, 2015

Maven: skip Test classes in Build and run in Integration Test

Link: http://cupofjava.de/blog/2013/02/05/integration-tests-with-maven-and-tomcat/

1). skip Test classes in Build
Skip the classes which contains Test in its name.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.12.1</version>
  <configuration>
    <excludes>
      <exclude>**/*Test*</exclude>
    </excludes>
  </configuration>
</plugin>

2). run Test in Integration Test

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <version>2.12.4</version>
  <configuration>
    <includes>
      <include>**/*Test*</include>
    </includes>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>integration-test</goal>
        <goal>verify</goal>
      </goals>
    </execution>
  </executions>
</plugin>


Continue ...

- Comments

0 nhận xét:

Đăng nhận xét