我想将多模块 Maven 项目中的 Scala 版本从 2.11 升级到 2.13。我更改了pom.xml中的所有Scala版本和Scala后缀版本,更新了依赖版本。我在编译中遇到下一个错误:
\target\generated-sources\twirl\txt\template.template.scala:12: object JavaConversions is not a member of package collection
Run Code Online (Sandbox Code Playgroud)
在目标文件夹中,我找到了旋转模板的编译对象:
import _root_.play.twirl.api.JavaScript
import _root_.play.twirl.api.Xml
....
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
object analyze_template extends _root_.play.twirl.api.BaseScalaTemplate[pla
Run Code Online (Sandbox Code Playgroud)
来自旋转模板:
@(sourceIncrementName: String, sourceSnapshotName: String)
Run Code Online (Sandbox Code Playgroud)
你能告诉我如何解决吗?
在 Maven 中,我有 scala-maven-plugin 和 twirl 插件:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmArgs>
<jvmArg>-Xms128m</jvmArg>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-XX:MaxPermSize=512m</jvmArg>
</jvmArgs>
<args>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-explaintypes</arg>
<arg>-feature</arg>
<arg>-language:implicitConversions</arg>
</args>
<recompileMode>incremental</recompileMode>
<scalaVersion>2.13</scalaVersion>
</configuration>
</plugin>
<plugin>
<groupId>com.jakewharton.twirl</groupId>
<artifactId>twirl-maven-plugin</artifactId>
<version>1.1.0</version>
<executions>
<execution> …Run Code Online (Sandbox Code Playgroud)