Skip to content

Multiple versions of Scala detected when importing from maven scala-compiler 2.11.12 #11176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adri242 opened this issue Sep 28, 2018 · 5 comments
Milestone

Comments

@adri242
Copy link

adri242 commented Sep 28, 2018

Given this dependency import from maven inside a pom.xml:

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>2.11.12</version>
        </dependency>

warning shown below is displayed:

[WARNING]  Expected all dependencies to require Scala version: 2.11.12
[WARNING]  org.scala-lang:scala-compiler:2.11.12 requires scala version: 2.11.12
[WARNING]  org.scala-lang.modules:scala-xml_2.11:1.0.5 requires scala version: 2.11.7
[WARNING] Multiple versions of scala libraries detected!

seems like the own dependency from scala-compile 2.11.12 is importing module scala-xml which requires scala version 2.11.7

I know this is not an updated version of Scala but I require it to use Apache Spark

@SethTisue SethTisue added this to the 2.13.0-M4 milestone Sep 28, 2018
@SethTisue
Copy link
Member

closing because as of Scala 2.13, there is no longer a dependency from scala-compiler to scala-xml

@SethTisue
Copy link
Member

see also scala/scala-xml#195 /cc @ashawley

@hrhino
Copy link

hrhino commented Sep 28, 2018

Also, 2.11.12 and 2.11.7 should be binary compatible, so the differing scala versions won't cause errors.

@ashawley
Copy link
Member

I'm not a Maven user, myself, but the warning makes sense.

Funny how sbt didn't ever complain about this, but I'm not an sbt expert either, so I'm sure there's some explanation.

I'll try to find some time to tinker with Maven and add something to the FAQ on the scala-xml Wiki.

@ashawley
Copy link
Member

The warnings will go away if you use a newer version of scala-maven-plugin correctly.

The sample Maven project for scala-modules is improved:

https://github.com/scala/scala-module-dependency-sample/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants