编译
.class
包含调试信息的文件需要在
maven-scala-plugin
水平。在
maven-compiler-plugin
-这是我们在文档中可以看到的默认值。
debug
默认为true的选项是无用的,因为它没有编译您的scala源代码。
现在,如果我们看看
scalac
man page
, the
斯卡拉克
编译器有一个
âg
可采用以下值的选项:
他说:“这是一个很好的选择。”
none
“不生成调试信息,
“
source
“只生成源文件属性,
“
line
“生成源和行号信息,
“
vars
“生成源、行号和局部变量信息,
“
notc
“生成以上所有内容,不会执行尾调用优化。
好消息是
scala:compile
有一个不错的
args
可用于传递的可选参数
编译器附加参数
. 所以,使用它并传递
-g
对于scala编译器的选项,您只需按如下方式配置maven插件:
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<args>
<arg>-g:notc</arg>
</args>
...
</configuration>
</plugin>
我跳过了配置的其他部分(例如
repositories
,
pluginRepositories
等)因为这不是你想要的。)