使用maven scala插件指定Scalac编译时选项
使用maven scala plugin 2.15.2,我试图将scala类文件的最大长度指定为“50”个字符。我在我的使用maven scala插件指定Scalac编译时选项,scala,maven,Scala,Maven,使用maven scala plugin 2.15.2,我试图将scala类文件的最大长度指定为“50”个字符。我在我的pom.xml中尝试了两个位置: <build> <plugins> <plugin> <groupId>org.scala-tools</groupId> <artif
pom.xml中尝试了两个位置:
<build>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<id>scala-compile-first</id>
<goals>
<goal>compile</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<scalacArgs> <-- Attempt #1 -->
<scalacArg>-Xmax-classfile-name 50</scalacArg>
</scalacArgs>
<scalaVersion>${scalaVer}</scalaVersion>
<args>
<arg>-make:transitive</arg>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
<!-- Attempt #2 -->
</args>
</configuration>
org.scala-tools
maven scala插件
2.15.2
scala先编译
编译
过程资源
-Xmax类文件名50
${scalaVer}
-make:及物的
-从属文件
${project.build.directory}/.scala\u依赖项
我还运行了mvn compile-Xmax classfile name 50
,但Maven没有识别出该选项,因此失败了
我在哪里可以使用maven scala插件指定此选项?在配置中使用args
的地方应该是放置编译器args的地方。您似乎还创建了scalacArgs
,但是args
被传递给scalac
我在插件中使用此选项将选项传递给编译器:
Maven 3不知道如何处理-Xmax类文件名:50
:[ERROR]scalac错误:错误选项:'-Xmax类文件名:50'。我在使用空格和等号分隔符时也遇到了同样的错误,即在选项和值之间使用空格和等号分隔符,而不是:
。Maven只是将它们传递给scalac。试试我最新的答案。谢谢,@monkjack。成功了。作为一个轻微的建议编辑,-Xmax classfile name
的参数必须介于~70
和其他一些数字(我不记得了)之间。maven scala插件已被弃用(因为超过2年了),请使用scala maven插件。(两个插件的创建者)谢谢你的提醒,大卫。谢谢你的插件