سؤال

I am creating a Scala project with sbt 0.11.2 and sbt-idea and I am getting UNRESOLVED DEPENDENCIES on the gen-idea task.

I've just installed sbt (downloaded jar and made script as instructed in the wiki), followed the sbt-idea setup here, made an empty directory for my project, and run sbt and then run the gen-idea task.

It can't find the dependency because it only uses the built-in repos. How do I tell sbt to check another repo?


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

Later in the process it downloads it successfully:

[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, things look good at first...

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

It moves on to creating .idea directories and such, which seem to be created just fine. It then starts resolving things again (scala tools, sbt, commens-*, etc)

Eventually it 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 it wouldn't find it at those locations, but I don't understand why it didn't try the github repo, as it did when configuring the plugin. I was expecting to see a line looking something like this:

[warn] ==== sbt-idea-repo: tried
هل كانت مفيدة؟

المحلول

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

resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.1-SNAPSHOT")

نصائح أخرى

This is documented in the sbt-idea README file here. Specifically:

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 experience problems with sbt 0.11 installation, see this.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top