Skip to content
davidB edited this page Mar 18, 2011 · 2 revisions

Tips

No test

To run maven without compiling+running test from commandline : mvn .... -Dmaven.test.skip=true

To fully disable test without commenting them : edit pom.xml

<properties>
  <maven.test.skip>true</maven.test.skip>
</properties>

I prefer using the property instead of directly configure surfire because :

  • don't require to add a surfire section if it doesn't already exists
  • some profile (eg : integration test) are enabled only if maven.test.skip != true (include false, not-define,...)

Incremental compilation

since scala 2.8.0 you could enable incremental compilation

  <plugin>
    <groupId>org.scala-tools</groupId>
    <artifactId>maven-scala-plugin</artifactId>
    <version>2.14.1</version>
    <executions>
      <execution>
        <id>cmain</id>
        <goals>
          <goal>compile</goal>
        </goals>
        <configuration>
          <args>
            <arg>-make:transitive</arg>
            <arg>-dependencyfile</arg>
            <arg>${project.build.directory}/.main_scala_dependencies</arg>
          </args>
        </configuration>
      </execution>
      <execution>
        <id>ctest</id>
        <goals>
          <goal>testCompile</goal>
        </goals>
        <configuration>
          <args>
            <arg>-make:transitive</arg>
            <arg>-dependencyfile</arg>
            <arg>${project.build.directory}/.test_scala_dependencies</arg>
          </args>
        </configuration>
      </execution>
    </executions>
    <configuration>
      <jvmArgs>
        <jvmArg>-Xms64m</jvmArg>
        <jvmArg>-Xmx1024m</jvmArg>
      </jvmArgs>
    </configuration>
  </plugin>
Clone this wiki locally