Incremental Scala compilation with Zinc

What is Zinc

Zinc is a standalone version of the incremental compiler for sbt GitHub page. Providing a “warmed-up” JVM it increases compilation speed. The scala-maven-plugin allows us to take advantage of incremental compilation from a Maven build.

Follow the link on the Zinc GitHub page to download latest stable version and install.

Running zinc

cd $ZINC_DIR/bin
./zinc -scala-home /usr/local/scala-2.10.4 -start
./zinc -status       #After compilation shows cached setup
./zinc -shutdown

Enable Zinc from scala-maven-plugin

 <plugin>
   <groupId>net.alchim31.maven</groupId>
   <artifactId>scala-maven-plugin</artifactId>
   <version>3.2.0</version>
   <executions>
    ...
   </executions>
   <configuration>
      <scalaVersion>${scala.version}</scalaVersion>
      <recompileMode>incremental</recompileMode>
      <useZincServer>true</useZincServer>
    ...

Resources