Unresolved dependency SBT org.scala-sbt#sbt_2.9.1;0.12.1: not found, Play examples
Solution 1
If you look at project/plugins.sbt, you will see that it expects play.version
system property to be set:
addSbtPlugin("play" % "sbt-plugin" % Option(System.getProperty("play.version")).getOrElse("2.0"))
So, you should either provide necessary play.version
property
$ sbt -Dplay.version=2.1-RC1
or simply change plugins.sbt
as
addSbtPlugin("play" % "sbt-plugin" % "2.1-RC1")
Solution 2
For Activator 1.0 users:
You may encounter this problem when upgrading a Play project to a later version after you load the project into Activator 1.0. That is because Activator creates files in the /project directory that look like activator-...-shim.sbt
. Delete those files and Activator should resolve the issue on your next compile.
Solution 3
I have solved the problem after switching to Play 2.1-RC1
I also had an issue with some dependencies which I solved inserting:
// The Typesafe snapshots repository
resolvers += "Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/"
in plugins.sbt
I was just following: https://github.com/playframework/Play20/wiki/Repositories
Solution 4
For play 2.0.2, version 2.0.2 of SBT worked just fine in my project. I changed the addSbtPlugin line in my plugins.sbt file to:
addSbtPlugin("play" % "sbt-plugin" % "2.0.2")
It should be analogous for earlier versions. As Labra already pointed out, since this version of SBT is not the latest anymore, you probably will need to add also the following resolver in order to get it:
resolvers += "Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/"
Another way of getting rid of this kind of problem is updating Play Framework for your project to the latest version if possible. This is probably the best choice in the long run as it allows you to keep your code base current.
Related videos on Youtube
Labra
I am spanish associate professor interested in Functional Programming (Haskell, Scala), Dynamic Programming languages (Ruby) and Semantic web technologies.
Updated on September 16, 2022Comments
-
Labra over 1 year
I am trying to run the samples in Play 2.0 framework but when I go to run "play" or "sbt".
When I go to directory "/samples/scala/helloworld", I execute "sbt" and I obtain:
[info] Loading project definition from C:\src\Play20\samples\scala\helloworld\project [warn] module not found: play#sbt-plugin;2.0 [warn] ==== typesafe-ivy-releases: tried [warn] http://repo.typesafe.com/typesafe/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml [warn] ==== sbt-plugin-releases: tried [warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml [warn] ==== local: tried [warn] C:\Users\labra\.ivy2\local\play\sbt-plugin\scala_2.9.2\sbt_0.12\2.0\ivys\ivy.xml [warn] ==== Typesafe repository: tried [warn] http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom [warn] ==== public: tried [warn] http://repo1.maven.org/maven2/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: play#sbt-plugin;2.0: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes. [warn] play:sbt-plugin:2.0 (sbtVersion=0.12, scalaVersion=2.9.2) [warn] sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214) . . . at java.lang.Thread.run(Thread.java:722) [error] (*:update) sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? [info] Loading project definition from C:\src\Play20\samples\scala\helloworld\project [warn] module not found: play#sbt-plugin;2.0 [warn] ==== typesafe-ivy-releases: tried [warn] http://repo.typesafe.com/typesafe/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml [warn] ==== sbt-plugin-releases: tried [warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml [warn] ==== local: tried [warn] C:\Users\labra\.ivy2\local\play\sbt-plugin\scala_2.9.2\sbt_0.12\2.0\ivys\ivy.xml [warn] ==== Typesafe repository: tried [warn] http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom [warn] ==== public: tried [warn] http://repo1.maven.org/maven2/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: play#sbt-plugin;2.0: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes. [warn] play:sbt-plugin:2.0 (sbtVersion=0.12, scalaVersion=2.9.2) [warn] sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214) at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122) . . . at java.lang.Thread.run(Thread.java:722) [error] (*:update) sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q
I installed sbt version 12.1 from http://www.scala-sbt.org/release/docs/Getting-Started/Setup
I noticed a similar question here: https://groups.google.com/forum/?fromgroups=#!topic/simple-build-tool/DGUbWsgZiLw
In the answers, it seems to be related to the "Launcher" version of SBT, How can I know whhich is my Launcher sbt version? And how can I update it?
I also tried to compile xsbt from source but, when running "sbt build-all", I obtain:
. . . [info] Reading library jar [C:\compi\jdk\jre\lib\rt.jar] [error] Error: Can't read [proguard.ClassPathEntry@73abdb5e] (Can't process class [com/oracle/net/Sdp$1.class] (Unsupported version number [51.0] for class format)) [error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded [error] Use 'last' for the full log.
However, my problem is not to compile xsbt, but to know how can I execute "Play's examples"
When running "sbt sbt-version" in a new folder I obtain:
[info] Set current project to default-85f41b (...) [info] 0.12.1
-
Labra over 11 yearsI did, but it is not working yet. It returns: [info] Loading project definition from C:\src\Play20\samples\scala\helloworld\project [error] C:\src\Play20\samples\scala\helloworld\project\Build.scala:2: not found: object Keys [error] import Keys._ [error] ^ [error] one error found [error] (compile:compile) Compilation failed
-
4e6 over 11 yearsI can only suggest to clean the project and try again.
-
Labra over 11 yearsDo you mean executing "sbt clean" ? Because I obtain the same error. I was looking for some help and I could find something related to Scala version, but I am not sure if that is the problem. My scala version is 2.9.2. How should I clean the project and try again?
-
4e6 over 11 yearsI meant something like
rm -rf Play20 && git clone git://github.com/playframework/Play20.git
-
Labra over 11 yearsThanks, but I am afraid that it is not yet working...same result
-
hama Mk almost 10 yearsthank you for posting this. I spent hours trying to figure out why I was getting errors and tried many different sbt/play version combos before I found this.