我正在尝试在我的maven项目中使用fsc(快速scala编译器)。我的pom.xml
有:
...
<execution>
<id>cc</id>
<goals>
<goal>cc</goal>
</goals>
<phase>compile</phase>
<configuration>
<useFsc>true</useFsc>
<once>true</once>
</configuration>
</execution>
...
在What is the fastest way to compile Scala files using maven?
中讨论过当我输入mvn scala:cc
时,它会挂起:
[INFO] wait for files to compile...
正在运行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
哪个看似奇怪(不应该不包括scala.tools.nsc.MainGenericRunner
?)我注意到MainGenericRunner.out
包含
no such file: scala.tools.nsc.CompileServer
这似乎证实了我的怀疑。
有没有人遇到这个,或者有解决方法?我真的很想用fsc来加速我的构建。我在Google群组中找到了一个具有类似输出的用户,但没有跟进。
在OSX上运行scala 2.8.1和maven 3.0.3
答案 0 :(得分:1)
当您调用mvn scala:cc
时,maven将使用未在您的pom中配置的执行ID default-cli(或类似的东西)。因为maven将使用cc目标的默认值。目前,您的pom配置为在“编译”阶段使用您的自定义执行cc目标。因此,运行mvn compile
或mvn install
之类的内容应该按预期运行。