您的位置:首页 > 其它

Scala-maven-plugin and Multiple Versions of Scala Libraries Detected

2015-12-18 18:31 639 查看
Have you ever seen messages like these running scala-maven-plugin?

1
2
3
4

[WARNING]  Expected all dependencies to require Scala version: 2.10.3
[WARNING]  mycoolcompany:mycoolproject:1.5.25 requires scala version: 2.10.3
[WARNING]  me.lessis:odelay-core_2.10:0.1.0 requires scala version: 2.10.4
[WARNING] Multiple versions of scala libraries detected!

Starting from scala 2.10 all changes in bugfix/patch version should be backward compatible, so these warnings don’t really have the point in this case.
But they are still very important in case when, let’s say, you somehow end up with scala 2.9 and 2.11 libraries. It happens that since version 3.1.6 you can fix this using 
scalaCompatVersion
 configuration

1
2
3
45
6
7
8
9
10

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.6</version>
<configuration>
<scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
<!-- other settings-->
</plugin>

Where in my case I have 
scala.binary.version
 property
defined as

1

<scala.binary.version>2.10</scala.binary.version>

No more meaningless warnings!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  scala