Since version 2.7 of the plugin, the scala version to use is detected from dependency to scala-library. So it suggested to not use scalaVersion configuration. But if you want to define explicitly the version of scala used to compile,... use 'scalaVersion', ex:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
本文介绍如何使用 Maven 的 Scala 插件来指定 Scala 编译版本,并提供了配置示例。从插件版本 2.7 开始,推荐通过依赖 scala-library 自动检测 Scala 版本。
445

被折叠的 条评论
为什么被折叠?



