Skip to content
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

Multiple versions of scala libraries detected #798

Open
tashoyan opened this issue Sep 20, 2023 · 2 comments
Open

Multiple versions of scala libraries detected #798

tashoyan opened this issue Sep 20, 2023 · 2 comments

Comments

@tashoyan
Copy link

tashoyan commented Sep 20, 2023

I get the following warning:

[WARNING]  Expected all dependencies to require Scala version: 2.12.18
[WARNING]  com.sksamuel.avro4s:avro4s-core_2.12:4.0.13 requires scala version: 2.12.7

I wonder why avro4s requires a precise version of Scala.

Tried with avro4s-core 4.1.1 and 4.0.13.
Java 11
Scala 2.12.18

Workaround: exclude Scala libs from transitive dependencies:

    <dependency>
      <groupId>com.sksamuel.avro4s</groupId>
      <artifactId>avro4s-core_2.12</artifactId>
      <version>4.1.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.scala-lang</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
@sksamuel
Copy link
Owner

I'm not sure how to fix it. If you want to make a PR I will merge and release.

@altrack
Copy link

altrack commented Dec 21, 2023

Seems to be Maven only issue.
On the other thread suggested solution was to upgrade: scala-maven-plugin.
2.12.18 is binary compatible with all 2.12 series according to Scala release notes.
I've tested package and assembly with sbt:
scala version 2.12.18 and avro4s-core 4.1.1
No issue whatsoever.

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

3 participants