How to run or not tests when I’m using maven ?

First you can configure or project for always run the tests or not .

SKYPE ALWAYS

To skip running the tests for a particular project, set the skipTests property to true.

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19</version>
        <configuration>
          <skipTests>true</skipTests>
        </configuration>
      </plugin>
    </plugins>
  </build>
  [...]
</project>


You can also skip the tests via the command line by executing the following command:

$ mvn clean install -DskipTests=true

           This will allow you to run with tests disabled by default and to run them with this command:

$ mvn clean install -DskipTests=false


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s