Unresolved dependency SBT 0.13.0 after update
Asked Answered
S

3

15

Update SBT to 0.13.0:

I have a couple of projects written with Scala 2.10.2 and build with sbt 0.12.4. As my OS is Ubuntu I used the SBT.deb package for installation of sbt 0.12.4. Everything fine. I built my projects with sbt.

Yesterday I wanted to update sbt to version 0.13.0. I downloaded and installed the new .deb package. The projects configuration has not been changed.

The failure:

When runnging SBT after the update I get this failure:


$ sbt
Loading /usr/share/sbt/bin/sbt-launch-lib.bash
Getting org.scala-sbt sbt 0.13.0 ...

:: problems summary ::
:::: WARNINGS
        module not found: org.scala-sbt#sbt;0.13.0

    ==== local: tried

      /home/myUser/.ivy2/local/org.scala-sbt/sbt/0.13.0/ivys/ivy.xml

        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

        ::::::::::::::::::::::::::::::::::::::::::::::

        :: org.scala-sbt#sbt;0.13.0: not found

        ::::::::::::::::::::::::::::::::::::::::::::::



:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.0: not found
Error during sbt execution: Error retrieving required libraries
  (see /home/myUser/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.0

The ~/.sbt/update.log file is available here: http://ubuntuone.com/6RDMgOqMnxdyKgfzrWVUNP The ~/.sbt/boot/.update.log file is available here: http://ubuntuone.com/4KqYnSL9Mc1yrmRLbCx6bI

How do I fix this dependency resolution?

Suspects:

  1. Other people had similar problems like this, but not the same. I don't think this is a problem of build definition incompatibility, do you? As far as I can see, SBT does not get to the point to read the project definition.

  2. From where does this file should be retrieved? Shouldn't it be included in the SBT installation package? Also it looks like SBT / Ivy does only look inside the local Ivy repo. There is no SBT artifact with version 0.13.0 in the Maven Central Repository. Do I have to specify another repo or something?

  3. And what about the Scala version? Shouldn't it be specified in the dependency definition? Do I have to specify the Scala version somewhere?

Project configuration:

File: build.sbt:


name := "MyProject"

version := "1.0-SNAPSHOT"

organization := "myOrg"

scalaVersion := "2.10.2"

libraryDependencies += "com.github.nscala-time" %% "nscala-time" % "0.4.2"

File: project/plugins.sbt:

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")

File: project/build.properties

Prior to this problem I did not have this file. I added it trying to solve this problem:

sbt.version=0.13.0
Sjambok answered 29/8, 2013 at 7:53 Comment(6)
Did you install the latest sbt-launch.jar? repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/…Marivelmariya
When I use the sbt.deb package, the sbt-launch.jar is included in installation and placed in /usr/share/sbt/bin/. I also removed the package and tried the manual installation, placing the sbt-launch.jar and a script in ~/bin/sbt/, but the result was the same. I think ivy should look for the missing sbt artifact the repo you linked to. Why it does not do this? And how do I tell sbt / ivy to look into that repo?Sjambok
I think this is the artifact that must be resolved: repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/…Sjambok
Now I installed the old version of sbt again and removed the build.properties file and sbt works again and I can build a project. Now I am asking: Is something wrong with the 0.13.0 sbt package?Sjambok
I got a step further. I added sbt-releases-repo: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] to ~/.sbt/repositories. When running sbt, ivy downloads several artifacts, but can't resolve anotherone for which I'm searching the repo now. Why must I workaround sbt's dependecies? That should not be my responsibility!Sjambok
The dependency currently not found is: org.scala-sbt#test-interface;1.0. It is not in the same repo, but there is an interface artifact, but maybe that is just something else.Sjambok
S
51

I added some repos to ~/.sbt/repositories. This solved the problem. Now the file looks like this:

[repositories]
  local
  sbt-releases-repo: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  sbt-plugins-repo: http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  maven-central: http://repo1.maven.org/maven2/

You should look at this, too: http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Proxy-Repositories.html

But what still worries me is the question if this is an individual case for me and my system or if others have such problems, too. Did I misunderstand something? Because if I want to use a build tool, I don't think it should be my responsibility to care about the tool's dependencies after installation. That should be done by the tool's installation itself.

Of course it is my responsibility to care about my project's dependencies.

Sjambok answered 29/8, 2013 at 12:37 Comment(6)
I have no such file in my ~/.sbt directory, and the update went OK. Still it's strange in your case.Marivelmariya
Maybe the new version does not need that file anymore, until proxy repos are used. Maybe I should remove that directory completely (with backup of course), reinstall sbt and try if it works again. No risk - no fun. :DSjambok
Worked for me. Many thanks! I was using 0.13.6 until an imported project required 0.13.7 in build.properties. Quite confusing: trying to upgrade sbt with homebrew had no effect.Amand
I have a hunch that if you don't have a repositories file then there are defaults that get used, but if you do have a repositories file then it's your responsibility to add the repos yourself.Casualty
Thank you so much! This is a proxy issue. Default repos all have https which can't be accessed due to proxy settings. Creating a new file ~/.sbt/repositories and entering those new repos fixes this issue because they use http.Aquacade
I have to change http to https otherwise will get SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/ch/epfl/scala/sbt-bloop_2.12_1.0/...Lampas
F
4

I ran into the same problem, turned out to be pebcak (of course), specifying 0.13 instead of 0.13.0 in project/build.properties

Stepping through the output in .sbt/boot/update.log was pretty useful and lead me to the issue (especially after I noticed that sbt ran ok in ~/ - downloading itself - I noticed the ivy.xml it was looking for didn't match the one it downloaded from that earlier attempt in ~/)

Firearm answered 5/9, 2013 at 1:52 Comment(0)
B
0

I had a similar error message when my version of Java on OSX was 1.6. Updating to 1.8 fixed this issue for me.

Bertilla answered 25/1, 2018 at 18:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.