Search code examples
scalamavensbtmaven-scala-plugin

sbt maven compatibility issues


I am facing an issue with sbt here https://github.com/dmlc/xgboost/issues/1858

strangely not even the maven variables are resolved

com.typesafe.akka#akka-actor_${scala.binary.version};2.3.11: not found

maven outputs these warnings during the build:

Expected all dependencies to require Scala version: 2.11.8
[WARNING]  com.typesafe.akka:akka-actor_2.11:2.3.11 requires scala version: 2.11.5
[WARNING] Multiple versions of scala libraries detected!

On a mac hard coding the scala version of the akka dependency seems to be a workaround. For windows or ubuntu this workaround does not work.

edit

<scala.binary.version>2.11</scala.binary.version> in https://github.com/dmlc/xgboost/blob/master/jvm-packages/pom.xml

and

<dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-actor_${scala.binary.version}</artifactId>
            <version>2.3.11</version>
            <scope>compile</scope>
</dependency>

in https://github.com/dmlc/xgboost/blob/e7fbc8591fa7277ee4c474b7371c48c11b34cbde/jvm-packages/xgboost4j/pom.xml

which I hard coded to

<dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-actor_2.11</artifactId>
            <version>2.3.11</version>
            <scope>compile</scope>
</dependency>

Solution

  • The problem is xgboost is using properties from the pom.xml which are defined in a non-default per profile section. SBT does not seem to be able to handle that see my pull request here https://github.com/dmlc/xgboost/issues/1858