Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I skip tests for the "compile" and "install" target only but not the "test" target?

I have a situation where our unit tests take a long time to execute for our business domain project as it sets up a database to a known state then proceeds to execute each step. I understand this can be done with "-Dmaven.test.skip=true" on the command line but wish to configure this within NetBeans for the project only, globally would be acceptable if anyone could clarify how to configure within the IDE.

How can I configure maven2 to only execute tests when the "test" target is called?

Using the following will disable tests even when the "test" target is called (from the maven docos).

<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.6</version>
    <configuration>
      <skipTests>true</skipTests>
    </configuration>
  </plugin>
</plugins>
like image 884
Brett Ryan Avatar asked Sep 06 '10 18:09

Brett Ryan


1 Answers

http://maven.apache.org/general.html#skip-test

Just specify -Dmaven.test.skip=true when you invoke a target and don't want to execute tests.

like image 161
Kyle W. Cartmell Avatar answered Oct 12 '22 22:10

Kyle W. Cartmell