使用Maven编译Scala文件的最快方法是什么? [英] What is the fastest way to compile Scala files using maven?

查看:138
本文介绍了使用Maven编译Scala文件的最快方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

理想情况下使用FSC编译器

ideally using the FSC compiler

问题变成我应该使用什么命令或pom文件设置?

Question becomes what command or pom file set up should I use?

我目前正在使用scala maven插件,但实际上似乎并没有使用fsc

I'm currently using the scala maven plugin but it doesn't seem to actually use fsc

谢谢

推荐答案

您可以通过将以下内容添加到pom.xml的plugins部分来运行fsc作为maven的编译阶段的一部分

You can run the fsc as part of the compile phase of maven by adding the following to the plugins section of your pom.xml

<plugin>
 <groupId>org.scala-tools</groupId>
 <artifactId>maven-scala-plugin</artifactId>
 <version>2.9.1</version>
 <executions>
  <execution>
   <id>cc</id>
   <goals>
     <goal>cc</goal>
   </goals>
   <phase>compile</phase>
   <configuration>
    <useFsc>true</useFsc>
    <once>true</once>
   </configuration>
  </execution>
 </executions>
</plugin>

当然,如果需要,您必须从POM中删除标准的scala编译执行.

Of course you have to remove the standard scala compile execution from your POM if necessary.

这篇关于使用Maven编译Scala文件的最快方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆