2
votes

When I use sbt the error message appears as below:

==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11/scala-library-2.11.pom
[warn] ==== bintray-spark-jobserver-maven: tried
[warn]   https://dl.bintray.com/spark-jobserver/maven/org/scala-lang/scala-library/2.11/scala-library-2.11.pom
[warn] ==== Typesafe Repo: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scala-lang/scala-library/2.11/scala-library-2.11.pom

It seems the "https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11/scala-library-2.11.pom" could not be found, and I check the page also does not exist.

It also causes the scala-library-2.11 jar to not be found.

On the other hand, when I check https://repo1.maven.org/maven2/org/scala-lang/scala-library/**2.11.0**/scala-library-**2.11.0**.pom this url exists.

How can I resolve this?

2
Show your build.sbt pleaseEvgeny
Yup, build.sbt would help, probably small detail like scalaVersion := "2.11" instead of scalaVersion := "2.11.0", but without the code it is hard to tell.Mateusz Kubuszok
Is this resolved, I am facing the same issue. If I put it as 2.11 it is causing issue in downloading scala-library but if I put it as 2.11.0 it is causing issue for other transitive dependent libraries like json4s etc.amandeep1991

2 Answers

0
votes

You need to change your scala version to 2.11.12 (or whatever minor version you want, but you need to specify all three parts, as in 2.11.12 or 2.11.8 etc).

How to Change Your Scala Version

There are two ways you can do this.

  1. You can do this from build.sbt directly by putting this in your file:
ThisBuild / scalaVersion := "2.11.12"
  1. You can also do this from the sbt console.

Open the sbt console:

sbt

Wait for it to start up, then set the version in the console by running the following:

sbt:my-project> ThisBuild / scalaVersion := "2.11.12"

This sets the version in the console but will not persist beyond this console session. To save this setting, run:

sbt:my-project> session save

This will save it to your build.sbt file for you.

Note: if you don't want to set the scalaVersion for all subprojects as well, don't scope the scalaVersion to ThisBuild; see here for details.

Update your packages

Now you can update your packages by running:

sbt:my-project> update

You should see something like:

[success] Total time: 0 s, completed Jul 10, 2020 5:19:31 AM
0
votes

I also faced this issue. Earlier, I was trying to shift burden to runtime to provide the dependency - but that's dodging the problem.

Finally, the issue was a transitive dependency relying on scalaVersion (or Scala.version) property specified in my project pom or sbt file.

After changing that to my expectations (2.11.8 specifically), things worked like charm.