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

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
4
5
6
7
8
9
10
      
          net.alchim31.maven
          scala-maven-plugin
          3.1.6
          
              ${scala.binary.version}
              ${scala.version}
          
          
        

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

1
2.10

No more meaningless warnings!

你可能感兴趣的:(scala,scala)