Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt unresolved dependencies sbt_2.9.1;0.7.4 sbt_2.9.1;0.7.7:

Tags:

scala

sbt

I was getting the unresolved dependencies like the question here.

Getting org.scala-tools.sbt sbt_2.9.1 0.7.7 ...

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

    ::          UNRESOLVED DEPENDENCIES         ::

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

    :: org.scala-tools.sbt#sbt_2.9.1;0.7.7: not found

    ::::::::::::::::::::::::::::::::::::::::::::::
like image 425
Win Myo Htet Avatar asked Jan 04 '12 02:01

Win Myo Htet


2 Answers

SBT 0.7.7 uses Scala 2.7.7 for the project configuration. SBT 0.11 uses Scala 2.9.1. You can use SBT 0.7.7 for configurations up to that version, but versions of SBT newer than 0.7.7 use a non-compatible configuration file.

Note that this is not related to the Scala version that will be used to compile the project itself, just the Scala version that is used to compile the configuration file. These are different things: you can use whatever version of Scala you want to compile your project, but you must use the version of Scala mandated by the SBT version to compile the project configuration.

To get an error message like that you must either have changed the Scala version for the project configuration, or used a newer SBT with a project written for an older version of SBT. Find out which it was, and correct the problem as needed.

I have an SBT 0.7.7 for projects that have not yet migrated to the new version, and the latest SBT for everything else. Put a different name on each script, and you are good to go.

like image 103
Daniel C. Sobral Avatar answered Sep 28 '22 06:09

Daniel C. Sobral


While sbt-launch.jar makes an attempt to download and use the version of sbt specified in the project's project/build.properties, they must be compiled with matching versions of Scala. I think sbt 0.7.7 was compiled with Scala 2.7, but the most recent versions of sbt are compiled with Scala 2.9.

Most folks now just use a version of sbt-launch.jar that matches the version specified in project/build.properties. If you're running on Linux, OS X, or pretty anything that can run a Bash script, I highly recommend the launch script from sbt-extras. It will automagically use the version of sbt-launch.jar according to what's specified in project/build.properties, and gives some other handy command line parameters.

If that doesn't work for you, I think your best bet is different launch scripts to launch the different minor versions of sbt. Such as sbt7, sbt10 and sbt11, which launch 0.7.7, 0.10.1 and 0.11.2, respectively.

like image 24
leedm777 Avatar answered Sep 28 '22 06:09

leedm777