Installing ensime in existing project cannot resolve dependency - scala

I started an android project in scala recently, I'm an emacs nerd, and I wanted to use ensime in emacs instead of IntelliJ. Per the installation instructions, and this post:
Installing Ensime for Scala Development on emacs: sbt.ResolveException: unresolved dependency: org.ensime#ensime-sbtt-cmd;0.12: not found
my ~/.sbt/plugins/plugins.sbt looks like this:
resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/snapshots"
addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.1.2")
and my project's project/plugins.sbt looks like this:
addSbtPlugin("org.scala-sbt" % "sbt-android" % "0.7.1-SNAPSHOT")
(though I don't think that's related).
When I run sbt, the output looks like the following:
[info] Loading global plugins from /Users/jmiles/.sbt/plugins
[info] Updating {file:/Users/jmiles/.sbt/plugins/}default-bdeac8...
[info] Resolving org.ensime#ensime-sbt-cmd;0.1.2 ...
[warn] module not found: org.ensime#ensime-sbt-cmd;0.1.2
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.ensime/ensime-sbt-cmd/scala_2.9.2/sbt_0.12/0.1.2/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/org.ensime/ensime-sbt-cmd/scala_2.9.2/sbt_0.12/0.1.2/ivys/ivy.xml
[warn] ==== local: tried
[warn] /Users/jmiles/.ivy2/local/org.ensime/ensime-sbt-cmd/scala_2.9.2/sbt_0.12/0.1.2/ivys/ivy.xml
[warn] ==== Sonatype releases: tried
[warn] https://oss.sonatype.org/content/repositories/snapshots/org/ensime/ensime-sbt-cmd_2.9.2_0.12/0.1.2/ensime-sbt-cmd-0.1.2.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/ensime/ensime-sbt-cmd_2.9.2_0.12/0.1.2/ensime-sbt-cmd-0.1.2.pom
[info] Resolving org.scala-sbt#precompiled-2_10_0-m7;0.12.1 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.ensime#ensime-sbt-cmd;0.1.2: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] org.ensime:ensime-sbt-cmd:0.1.2 (sbtVersion=0.12, scalaVersion=2.9.2)
[warn]
sbt.ResolveException: unresolved dependency: org.ensime#ensime-sbt-cmd;0.1.2: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:102)
at sbt.IvySbt.liftedTree1$1(Ivy.scala:49)
(etc.)
Any help?

I get this all the time with dependencies. While I have no explanation for it, here are the common patterns that recur over and over.
Often, the code given by the plugin/library developer is wrong. When I go to their maven repository the version they have listed doesn't exist in the repository. I just update it to the right version and then boom it works. Also, for some reason some plugins work when I put them in plugins.sbt (the suggested place). While others only work if I stick them in project/build.sbt. It doesn't make sense, but as soon as I move it there it suddenly installs and runs. Combined dependency listings. If you are hacking stuff together and stick a dependency in both build.scala and build.sbt, it will throw a generic error that is completely unhelpful. Remove one or the other and suddenly it runs.
Also keep in mind that % causes a scala version to be appended to the name of it. whereas %% defines the name explicitly. Sometimes this causes errors when using % because it doesn't have a version available for that scala version. Go to the repository and enter the name of the package explicitly to fix this.

ensime 0.1.2 is only for sbt version 0.13.x. If this is a new project, you might consider using the current version of sbt. Typically you'd do this by creating project/build.properties that contains sbt.version=0.13.0

Related

Scala sbt scoverage plugin resolution with Nexus proxy

I am using scoverage plugin in my project project/plugins.sbt:
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
This resolves fine when I do not use our company nexus.
To test our nexus proxy I added below at ~./sbt/repositories:
[repositories]
local
maven-releases: https://repo.example.net/nexus/repository/proxy-central.maven.org/
ivy-releases: https://repo.example.net/nexus/repository/proxy-repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
sbt-plugin-releases: https://repo.example.net/nexus/repository/proxy-repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
I delete the ~./ivy2/cache and when I try compiling:
[warn] ==== maven-releases: tried
[warn] https://repo.jamba.net/nexus/repository/proxy-central.maven.org/org/scoverage/sbt-scoverage_2.12_1.0/1.5.1/sbt-scoverage-1.5.1.pom
[warn] ==== ivy-releases: tried
[warn] https://repo.jamba.net/nexus/repository/proxy-repo.typesafe.com/typesafe/ivy-releases/org.scoverage/sbt-scoverage/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.jamba.net/nexus/repository/proxy-repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scoverage/sbt-scoverage/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scoverage#sbt-scoverage;1.5.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] org.scoverage:sbt-scoverage:1.5.1 (scalaVersion=2.12, sbtVersion=1.0)
I noticed that sbt coverage has a directory structure which includes scala and sbt version: https://repo1.maven.org/maven2/org/scoverage/sbt-scoverage_2.12_1.0/1.5.1/sbt-scoverage-1.5.1.pom
I also tried to change project/plugins.sbt to no avail:
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1", scalaVersion="2.12", sbtVersion="1.0")
Is there a reason why my maven proxy is not downloading this plugin from maven central (although it clearly exists)
Note: the proxy resolution works for ivy style releases and other maven releases.
EDIT:
Note I: Resolution of artifacts without using the proxy (directly from maven central) works perfectly. That is how I concluded that there must be something missing in the proxy configuration. Any/all pointers would be helpful.
Note II: Resolution of other artifacts (including sbt-assembly plugin, sbt itself, scala-reflect etc works perfectly with my proxy)
Set the Nexus proxy layout to permissive

Unresolved dependency when `dependOn` a local project

I have a scala project which is build using sbt. I want to import another project, which is also build using sbt, and which is local on my machine.
My project structure looks like this:
my-project/build.sbt
my-project/external-project/
my-project/external-project/build.sbt
my-project/external-project/...
my-project/src/test
my-project/src/main
my-project/...
my build.sbt looks like this:
lazy val root = Project("my-project", file("."))
.dependsOn(RootProject(file("./external-project/")))
.settings(
...
)
and this is what sbt "compile" gives me
[warn] Binary version (2.11) for dependency org.scala-lang#scala-library;2.11.8
[warn] in my-project#my-project_2.10;0.1-SNAPSHOT differs from Scala binary version in project (2.10).
[info] Resolving externalproject#externalproject.10;0.1 ...
[warn] module not found: externalproject#externalproject.10;0.1
[warn] ==== local: tried
[warn] /home/martin/.ivy2/local/externalproject/externalproject_2.10/0.1/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/externalproject/externalproject_2.10/0.1/externalproject_2.10-0.1.pom
[info] Resolving com.github.scopt#scopt_2.11;3.5.0 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: externalproject#externalproject_2.10;0.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] externalproject:externalproject_2.10:0.1
[warn] +- my-project:my-project_2.10:0.1-SNAPSHOT
The external project is a git submodule. Neither projects uses Maven in any way.
I just want the files in my-project to be able to import the scala files in external-project, but I can't get it to work. What am I doing wrong? Do I need to restrcture my project?
You haven't specified the scalaVersion for the current project, and it defaults to 2.10. For your external project you have specified some scalaVersion from the 2.11 series. You can see this in the artifact's name: externalproject_2.10, where the _2.10 suffix stands for the Scala version the artifact was built with. Your external project doesn't provide an artifact for Scala 2.10, hence this error. Since Scala major releases are not binary compatible, you can't combine them dependency-wise.
To fix this, specify the Scala version in your build.sbt: scalaVersion := "2.11.8".

SBT 0.13.1 offline

I'm trying to understand the use of SBT 0.13.1 offline. My goal is to bring whatever is necesary to an offline environment on a USB stick. I thought that if the ivy cache was copied then SBT could pull everything it needs out of it, but that doesn't seem to be the case.
For example...
I'll start by deleting the .ivy2 folder, just to be sure. Now, while online I use the following build.sbt and project/plugins.sbt files to create my eclipse project. from SBT 0.13.1
build.sbt:
name := "TestProject"
version := "0.0.1"
scalaVersion := "2.10.3"
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-math3" % "3.2",
"ch.qos.logback" % "logback-classic" % "1.1.1"
)
project/plugins.sbt:
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0")
Sill on the same computiner I go offline, and now sbt clean eclipse gives lots of unresolved dependency errors. E.g.
[warn] Host repo1.maven.org not found. url=http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] module not found: org.scala-lang#scala-library;2.10.3
[warn] ==== local: tried
[warn] /home/user/.ivy2/local/org.scala-lang/scala-library/2.10.3/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.pom
[info] Resolving ch.qos.logback#logback-classic;1.1.1 ...
[warn] Host repo1.maven.org not found. url=http://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.1.1/logback-classic-1.1.1.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] module not found: ch.qos.logback#logback-classic;1.1.1
[warn] ==== local: tried
[warn] /home/user/.ivy2/local/ch.qos.logback/logback-classic/1.1.1/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.1.1/logback-classic-1.1.1.pom
[info] Resolving org.scala-lang#scala-reflect;2.10.3 ...
[warn] Host repo1.maven.org not found. url=http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.3/scala-reflect-2.10.3.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] module not found: org.scala-lang#scala-reflect;2.10.3
[warn] ==== local: tried
[warn] /home/user/.ivy2/local/org.scala-lang/scala-reflect/2.10.3/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.3/scala-reflect-2.10.3.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-library;2.10.3: not found
[warn] :: ch.qos.logback#logback-classic;1.1.1: not found
[warn] :: org.scala-lang#scala-reflect;2.10.3: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
Is it really impossible to clean when working offline?
I notice that SBT is looking in .ivy2/local, but there is no such folder. Only '.ivy2/cache'.
Update:
Suggestion to add .ivy2/local didn't work. It gives many MalformedURLException
[warn] :: org.scala-lang#scala-library;2.10.3: ivy2 cache: unable to get resource for org/scala-lang#scala-library;2.10.3: res=/home/user/.ivy2/cache/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.pom: java.net.MalformedURLException: no protocol: /home/user/.ivy2/cache/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.pom
It's looking for a directory org/scala-lang etc, but thr directories in cache are of the form org.scala-lang
Update 2
It seems that the problem is caused with some interaction with logback. I've created a clearer version of my question here, and am accepting the answer that indicated that this 'should' run out of the box.
If you build the project online, then you can go offline after.
Basically, you'd just want to copy the ~/.ivy2 folder (and possibly ~/.sbt folder - unsure) into your environment from a location that has done the building and dependency resolution before.
Removing target/ in a project, then going offline, I can see that this does cause the resources to be resolved.
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 4 Scala sources to [...]
I'm not sure this will work but I guess you need to add another resolver in your Build.scala (or build.sbt) like this:
resolvers += "ivy2 cache" at "/home/user/.ivy2/cache"
Let me know if this works, I'm also curious about it.
Edit:
I tried it and sbt does look in your ivy2 cache, go in your build.sbt and add this line:
resolvers += Resolver.file("ivy2 cache", file("/path/to/your/ivy2/cache/"))(Resolver.ivyStylePatterns)
Now SBT should be looking in that directory too.

Unresolved dependencies for np 0.2.0 with SBT 0.13?

Scala 2.10.2 and SBT 0.13
I'm trying to use the np plugin and added the following lines to ../0.13/np.sbt:
seq(npSettings:_*)
(NpKeys.defaults in (Compile, NpKeys.np)) ~= {
_.copy(org="me.lessis", version="0.1.0-SNAPSHOT")
}
and this to <home-directory>/.sbt/plugins.sbt
addSbtPlugin("me.lessis" % "np" % "0.2.0")
resolvers += Resolver.url("sbt-plugin-releases",url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
When I execute sbt run I am getting :
[info] Updating {file:/home/Projects/helloSbt/}default-310e5b...
[info] Resolving me.lessis#np;0.2.0 ...
[warn] module not found: me.lessis#np;0.2.0
[warn] ==== local: tried
[warn] /home/.ivy2/local/me.lessis/np/scala_2.10/sbt_0.12/0.2.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/me.lessis/np/scala_2.10/sbt_0.12/0.2.0/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/me/lessis/np_2.10_0.12/0.2.0/np-0.2.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: me.lessis#np;0.2.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] me.lessis:np:0.2.0 (sbtVersion=0.12, scalaVersion=2.10)
[warn]
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: me.lessis#np;0.2.0: not found
[error] Total time: 3 s, completed Feb 6, 2014 9:23:17 AM
What am I doing wrong ?
For scala 2.10 you have to use sbt 0.13. I tried with sbt 0.13
Open in browser link:
http://dl.bintray.com/sbt/sbt-plugin-releases/me.lessis/np/scala_2.10/
There is only:
sbt_0.13/
For scala 2.9.2 you need to use sbt 0.12
==========================
Update:
Remove global configuration from $HOME/.sbt (plugins.sbt). or make or action from fresh user account (new user never used sbt)
Create empty directory test
Go to test
Create directory project
Go to project
Create plugins.sbt with content as above in question
Go to test directory
run sbt test or other command
see output - me.lessis#np;0.2.0 should be downloaded
Use .sbt/0.13/plugins/plugins.sbt (note the 0.13/plugins in the path) or even better for quick scan of the plugins installed, use .sbt/0.13/plugins/np.sbt so it's clear from the file name(s) about the plugins.
Please also note that from the question it appears that you're using SBT 0.12:
me.lessis:np:0.2.0 (sbtVersion=0.12, scalaVersion=2.10)
Add project/build.properties under helloSbt with the following line to have 0.13 be in use:
sbt.version=0.13.1

Unresolved dependency SBT org.scala-sbt#sbt_2.9.1;0.12.1: not found, Play examples

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
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")
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.
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
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.
Following Jose's answer, I made it work but with this resolver:
"Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/maven-releases"