I want to upgrade Scala version in multimodule maven project from 2.11 to 2.13. I changed all Scala version and Scala suffix version in pom.xml, updated the dependency version. I got next error in compilation:
\target\generated-sources\twirl\txt\template.template.scala:12: object JavaConversions is not a member of package collection
In target folder I found compiled object of twirl template:
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
From twirl template:
@(sourceIncrementName: String, sourceSnapshotName: String)
Could you tell me how to resolve it?
In maven I have scala-maven-plugin and twirl plugin:
<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>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
And twirl dependency:
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>twirl-api_2.13</artifactId>
</dependency>
import scala.jdk.CollectionConverters._
– UgrianJavaConversions
was always a bad idea and discouraged, they were deprecated on2.12
and finally removed on2.13
. If this code is autogenerated, you simply can not upgrade until the plugin fixes this error, you may want to open an issue (or maybe a PR) on the original project. – Magnate