Maven improperly starting fsc?

352 views Asked by At

I am trying to use fsc (fast scala compiler) with my maven project. My pom.xml has:

...
 <execution>
   <id>cc</id>
   <goals>
     <goal>cc</goal>
   </goals>
   <phase>compile</phase>
   <configuration>
     <useFsc>true</useFsc>
     <once>true</once>
   </configuration>
 </execution>
...

as discussed in What is the fastest way to compile Scala files using maven?

When I type mvn scala:cc, it hangs on:

[INFO] wait for files to compile...

Running mvn scala:cc -DdisplayCmd=true -Dverbose=true

 [INFO] cmd:  /bin/sh -c .../java -classpath [redacted] scala.tools.nsc.MainGenericRunner scala.tools.nsc.CompileServer >MainGenericRunner.out 2>MainGenericRunner.err

Which seems odd (shouldn't it not include scala.tools.nsc.MainGenericRunner?) I noticed that MainGenericRunner.out contains

no such file: scala.tools.nsc.CompileServer

which seems to confirm my suspicion.

Has anyone encountered this, or have a work around? I'd really like to use fsc to speed up my builds. I found one user with a similar output on google groups, but no follow ups.

Running scala 2.8.1 and maven 3.0.3 on OSX

1

There are 1 answers

1
hgrey On

When you invoke mvn scala:cc maven will use execution id default-cli (or something similar) which is not configured in your pom. Because of that maven will be using defaults of cc goal. Currently your pom is configured to execute cc goal with your customizations during "compile" phase. So, running something like mvn compile or mvn install should be working as you expect.