What is the correct sbt idea setup with sbt 0.11?

I create a Scala project with sbt 0.11.2 and sbt-idea, and I get UNRESOLVED DEPENDENCIES in the gen-idea task.

I just installed sbt (downloaded jar and made a script as indicated in the wiki), after installing sbt-idea here , created an empty directory for my project and run sbt and then run the gen-idea task.

It cannot find the dependency, since it uses only the built-in repositories. How to tell sbt to check another repo?


When I put the build.sbt file in the plugins directory and run sbt, it starts to allow things, one of which is Resolving com.github.mpeltonen#sbt-idea;0.11.0 ...

Later in the process, it successfully loads it:

 [info] downloading http://mpeltonen.github.com/maven/com/github/mpeltonen/sbt-idea_2.9.1_0.11.2/0.11.0/sbt-idea-0.11.0.jar ... [info] [SUCCESSFUL ] com.github.mpeltonen#sbt-idea;0.11.0!sbt-idea.jar (592ms) 

When I run the gen-idea task, everything looks good at first ...

 > gen-idea [info] Trying to create an Idea module default-b91f2c 

He goes on to create .idea directories and those that seem to be created just fine. Then it starts to understand again (scala tools, sbt, commens- *, etc.)

In the end, he tries to resolve sbt-idea :

 [warn] module not found: com.github.mpeltonen#sbt-idea;0.11.0 [warn] ==== local: tried [warn] /home/scaladev/.ivy2/local/com.github.mpeltonen/sbt-idea/scala_2.9.1/sbt_0.11.2/0.11.0/ivys/ivy.xml [warn] ==== typesafe-ivy-releases: tried [warn] http://repo.typesafe.com/typesafe/ivy-releases/com.github.mpeltonen/sbt-idea/0.11.0/ivys/ivy.xml [warn] ==== public: tried [warn] http://repo1.maven.org/maven2/com/github/mpeltonen/sbt-idea_2.9.1_0.11.2/0.11.0/sbt-idea-0.11.0.pom [warn] ==== Scala-Tools Maven2 Repository: tried [warn] http://scala-tools.org/repo-releases/com/github/mpeltonen/sbt-idea_2.9.1_0.11.2/0.11.0/sbt-idea-0.11.0.pom [warn] ==== Scala-Tools Maven2 Snapshots Repository: tried [warn] http://scala-tools.org/repo-snapshots/com/github/mpeltonen/sbt-idea_2.9.1_0.11.2/0.11.0/sbt-idea-0.11.0.pom [info] Resolving commons-io#commons-io;2.0.1 ... [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.github.mpeltonen#sbt-idea;0.11.0: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes. [warn] com.github.mpeltonen:sbt-idea:0.11.0 (sbtVersion=0.11.2, scalaVersion=2.9.1) [warn] 

I understand that he will not find it in these places, but I do not understand why he did not try the github repository, as it was when setting up the plugin. I expected to see a line that looked something like this:

 [warn] ==== sbt-idea-repo: tried 
+7
source share
2 answers

The gen-idea plugin for sbt 0.11.2 has not yet been published, but the 0.11.1 version of SNAPSHOT should work as expected:

 resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/" addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.1-SNAPSHOT") 
+3
source

This is described in the README sbt-idea file here . In particular:

Add the following lines to ~ / .sbt / plugins / build.sbt or PROJECT_DIR / project / plugins.sbt

 resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/" addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.0") 

NOTE. If you are having trouble installing sbt 0.11, see this .

+2
source

All Articles