我的pom.xml中有以下内容:
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
</args>
</configuration>
</plugin>我的主要目标是:
object App {
def main(args: Array[String]) {
args.foreach(println)
}
}然后它会打印:
$ mvn scala:run -DaddArgs='hello|world'
[...]
-unchecked
-deprecation
hello
world为什么?前两个是编译器参数(它们实际上是这样工作的),我不想在我的程序中看到它们!
我能做些什么来避免这种行为?
发布于 2011-11-20 20:34:49
如果您想尝试使用sbt,在项目根目录中添加一个简单的build.sbt:
name := "test"
version := "0.1-SNAPSHOT"
scalaVersion := "2.9.1"然后你就可以运行它了
% xsbt
> run Hello World
...
Hello
Worldhttps://stackoverflow.com/questions/8200863
复制相似问题