Thursday 7 April 2016

Skipping Tests in maven

If you want to skip test of project enable the surefire plugin in pom.xml

configuration :

type : false - enables the test suite to run.
          true  - enables to skip the test.
command : mvn install -Dmaven.test.skip=true

pom.xml configuration :

<project>
  [...]
  <properties>
    <skipTests>true</skipTests>
  </properties>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
        <configuration>
          <skipTests>${skipTests}</skipTests>
        </configuration>
      </plugin>
    </plugins>
  </build>
  [...]
</project>
Ref : maven

No comments:

Post a Comment