加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – Maven不正确地启动fsc?

发布时间:2020-12-16 08:51:03 所属栏目:安全 来源:网络整理
导读:我试图在我的maven项目中使用fsc(快速 scala编译器).我的pom.xml有: ... execution idcc/id goals goalcc/goal /goals phasecompile/phase configuration useFsctrue/useFsc oncetrue/once /configuration /execution... 正如What is the fastest way to co
我试图在我的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来加速我的构建.我发现一个用户在谷歌群组中具有类似的输出,但没有跟进.

在OSX上运行scala 2.8.1和maven 3.0.3

解决方法

当您调用mvn scala时:cc maven将使用未在您的pom中配置的执行ID default-cli(或类似的东西).因为maven将使用cc目标的默认值.目前,您的pom配置为在“编译”阶段使用您的自定义执行cc目标.因此,运行mvn compile或mvn install之类的东西应该按预期工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读