mpeltonen / sbt-idea

A simple-build-tool (sbt) plugin/processor for creating IntelliJ IDEA project files
Other
1.07k stars 153 forks source link

Unresolved Dependencies sbt-idea:0.11.0 (sbtVersion=0.11.2, scalaVersion=2.9.1) #119

Closed dhinojosa closed 12 years ago

dhinojosa commented 12 years ago

Using SBT 0.11.2. I tried 0.11.1 and 0.11.2 dependencies. Is there a different way to load plugins. I did move my .sbt file into project already.

[warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.github.mpeltonen#sbt-idea;0.11.1: 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.1 (sbtVersion=0.11.2, scalaVersion=2.9.1) [warn] [error] {file:/home/danno/testing_scala_book.git/testingscala/project/}default-bd12c2/*:update: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.1: not found

mpeltonen commented 12 years ago

Try version 0.11.0 (or 0.11.1-SNAPSHOT) for the plugin with sbt 0.11.2. See http://mpeltonen.github.com/maven/com/github/mpeltonen/sbt-idea_2.9.1_0.11.2/

dhinojosa commented 12 years ago

Yes, I had tried the different ones, I may have forgot to do a reload-plugins when I did so. Trying again.

dhinojosa commented 12 years ago

Mikko,

What should the plugin.sbt look like now? Also I moved plugins.sbt to project from project/plugins per sbt warnings.

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

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

Anything else that needs to be changed?

mpeltonen commented 12 years ago

That should be all. Remember to also remove the project/plugins -directory, because if the directory exists, project/plugins.sbt is ignored.

vraskin commented 12 years ago

Hey Daniel, Have you figured out how to resolve the above dependency ?

I tried the above plugin configuration in "/.sbt/plugins/build.sbt" and in "project/plugins.sbt". I tried to remove target directories from under the project, and there is no project/plugins directory.

"gen-idea no-sbt-classifiers" does not create error, but, I think I do not get all dependencies into my idea project, right? ( I am just starting to play with this )

Thanks.

andypetrella commented 12 years ago

Guyz, I've the same problem, using the no classifiers too... I still see com.github.mpeltonen:sbt-idea:0.11.0 (sbtVersion=0.11.2-20111116-052110, scalaVersion=2.9.1)

As you can see the classifier is present !!

Any clues might help thanks in advance

mpeltonen commented 12 years ago

Hmm, so are you sure you're using the official sbt 0.11.2 and not some snapshot version? I've never seen the timstamp (which in Maven world means a snapshot) in sbt version in those error messages.

barodeur commented 12 years ago

Hello ! I have the same issue with sbt 0.11.2 from http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.11.2/sbt-launch.jar

dhinojosa commented 12 years ago

All, I gave it a try again, and got the same results. Now when I run ./sbt reload plugins, it runs fine. I get the error afterwards when I do > gen-idea

Here is the stack:


> gen-idea    
[info] Trying to create an Idea module default-cef86a
[info] Updating {file:/home/danno/testing_scala_book.git/testingscala/}default-cef86a...
[info] Resolving org.scala-lang#scala-library;2.9.0-1 ...
[info] Resolving joda-time#joda-time;1.6.2 ...
[info] Resolving org.scalatest#scalatest_2.9.0-1;1.6.1 ...
[info] Done updating.
[info] Resolving org.scala-lang#scala-library;2.9.0-1 ...
[info] Resolving joda-time#joda-time;1.6.2 ...
[info] Resolving org.scalatest#scalatest_2.9.0-1;1.6.1 ...
[info] Excluding folder target
[info] Created /home/danno/testing_scala_book.git/testingscala/.idea/IdeaProject.iml
[info] Created /home/danno/testing_scala_book.git/testingscala/.idea
[info] Excluding folder /home/danno/testing_scala_book.git/testingscala/target
[info] Created /home/danno/testing_scala_book.git/testingscala/.idea_modules/default-cef86a.iml
[info] Resolving org.scala-tools.sbt#sbt_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#main_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#actions_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#classfile_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#io_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#control_2.9.1;0.11.2 ...
[info] Resolving org.scala-lang#scala-library;2.9.0-1 ...
[info] Resolving org.scala-tools.sbt#interface;0.11.2 ...
[info] Resolving org.scala-tools.sbt#logging_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#process_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#classpath_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#launcher-interface_2.9.1;0.11.2 ...
[info] Resolving org.scala-lang#scala-compiler;2.9.0-1 ...
[info] Resolving org.scala-tools.sbt#incremental-compiler_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#collections_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#api_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#persist_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbinary#sbinary_2.9.0;0.4.0 ...
[info] Resolving org.scala-tools.sbt#compile_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#ivy_2.9.1;0.11.2 ...
[info] Resolving org.apache.ivy#ivy;2.2.0 ...
[info] Resolving com.jcraft#jsch;0.1.31 ...
[info] Resolving commons-httpclient#commons-httpclient;3.1 ...
[info] Resolving commons-logging#commons-logging;1.0.4 ...
[info] Resolving commons-codec#commons-codec;1.2 ...
[info] Resolving org.scala-tools.sbt#completion_2.9.1;0.11.2 ...
[info] Resolving jline#jline;0.9.94 ...
[info] Resolving org.scala-tools.sbt#run_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#task-system_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#tasks_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#tracking_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#cache_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#testing_2.9.1;0.11.2 ...
[info] Resolving org.scala-tools.testing#test-interface;0.5 ...
[info] Resolving org.scala-tools.sbt#compiler-interface;0.11.2 ...
[info] Resolving org.scala-tools.sbt#precompiled-2_8_1;0.11.2 ...
[info] Resolving org.scala-tools.sbt#precompiled-2_8_0;0.11.2 ...
[info] Resolving org.scala-tools.sbt#precompiled-2_9_0;0.11.2 ...
[info] Resolving com.github.mpeltonen#sbt-idea;0.11.1-SNAPSHOT ...
[warn]  module not found: com.github.mpeltonen#sbt-idea;0.11.1-SNAPSHOT
[warn] ==== local: tried
[warn]   /home/danno/.ivy2/local/com.github.mpeltonen/sbt-idea/scala_2.9.1/sbt_0.11.2/0.11.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== typesafe-ivy-releases: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/com.github.mpeltonen/sbt-idea/0.11.1-SNAPSHOT/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.1-SNAPSHOT/sbt-idea-0.11.1-SNAPSHOT.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.1-SNAPSHOT/sbt-idea-0.11.1-SNAPSHOT.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.1-SNAPSHOT/sbt-idea-0.11.1-SNAPSHOT.pom
[info] Resolving commons-io#commons-io;2.0.1 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.github.mpeltonen#sbt-idea;0.11.1-SNAPSHOT: 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.1-SNAPSHOT (sbtVersion=0.11.2, scalaVersion=2.9.1)
[warn] 
[error] {file:/home/danno/testing_scala_book.git/testingscala/}default-cef86a/*:update-sbt-classifiers: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.1-SNAPSHOT: not found
[info] Created /home/danno/testing_scala_book.git/testingscala/.idea_modules/project.iml

Now I have a build.sbt in the root of the project:

name := "Testing Scala" 

version := "1.0"

scalaVersion := "2.9.0-1"

libraryDependencies ++= Seq("org.scalatest" % "scalatest_2.9.0-1" % "1.6.1" % "test" withSources() withJavadoc(),
                            "joda-time" % "joda-time" % "1.6.2" withSources() withJavadoc())

In project/plugins.sbt

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

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

I have deleted project/project project/target and target folder before doing this.

mpeltonen commented 12 years ago

If you're using 0.11.0 version of the plugin with sbt 0.11.2, you should use "gen-idea no-sbt-classifiers". It includes in Idea metafiles everything but source jars of sbt jar files, which should not be a big problem in normal case.

Version 0.11.1-SNAPSHOT should work ok with just "gen-idea" in this regard (i.e. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.1-SNAPSHOT")).

mpeltonen commented 12 years ago

Ok, I got the error too after removing my whole ~/.ivy/.

There's still some problem when not using "no-sbt-classifiers". Sbt tries to resolve the plugin in update-sbt-classifiers task, but is for some reason unable to do so. "gen-idea no-sbt-classifiers" should be decent workaround anyway.

isterin commented 12 years ago

Getting same issue here. Works with no-sbt-classifiers though. Let us know when it's fixed. Thanks!

bdargan commented 12 years ago

I'm getting same kind of problem. plugins.sbt is

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

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

[info] Resolving com.github.mpeltonen#sbt-idea;0.11.0 ... [warn] module not found: com.github.mpeltonen#sbt-idea;0.11.0 [warn] ==== local: tried [warn] /Users/Brett/.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] [error] {file:/work/soc2011/first-akka-sbt/}default-b4b137/*:update-sbt-classifiers: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.0: not found

sbt version is 0.11.2

mpeltonen commented 12 years ago

It looks like this is related to this sbt issue: https://github.com/harrah/xsbt/issues/304

mpeltonen commented 12 years ago

'no-sbt-classifiers' behavior is now the default in master.

ijuma commented 12 years ago

Did you push the change? I didn't see it.

mpeltonen commented 12 years ago

Not yet, and changed the version :)

But should be out now, with 1.0.0 version!

ijuma commented 12 years ago

Cool! :)

OlegYch commented 12 years ago

oh noes how can I can get all the sources by default now?

ijuma commented 12 years ago

You will still get the sources for libraries (including Scala). You will not get sources for SBT and plugins.

OlegYch commented 12 years ago

but i want to get all of them (including sbt and plugins) it was working before, but now 'gen-idea sbt-classifiers' doesn't attach any sources to sbt-and-plugins library

mpeltonen commented 12 years ago

You need to publish-local sbt-idea sources for the sbt-classifiers to work. I.e. someting like this seems to work:

Now 'gen-idea sbt-classifiers' should work and include sbt sources in Idea files. At least this worked for me.

OlegYch commented 12 years ago

thanks this worked! hope this would be resolved properly though, I consider the ability to flawlessly get sources for the libraries you use to be important

dhinojosa commented 12 years ago

I can't wait, and I guess it should also map docs too. But I guess I will find out. I appreciate all that you do, Mikko.

On Sat, Jan 21, 2012 at 11:03 AM, Mikko Peltonen < reply@reply.github.com

wrote:

You need to publish-local sbt-idea sources for the sbt-classifiers to work. I.e. someting like this seems to work:

  • First, you may need to run 'rm ~/.ivy2/cache/scala_2.9.1/sbt_0.11.2/com.github.mpeltonen/sbt-idea/ivy*' to clean up ivy files. This may depend on if you've publish-local'd some other versions of the plugin.
  • Clone the sbt-idea repo if you haven't already, or pull latest changes
  • git co 1.0.0
  • ./sbt publish-local

Now 'gen-idea sbt-classifiers' should work and include sbt sources in Idea files. At least this worked for me.


Reply to this email directly or view it on GitHub: https://github.com/mpeltonen/sbt-idea/issues/119#issuecomment-3597764

Daniel Hinojosa Programmer, Instructor, and Consultant dhinojosa@evolutionnext.com http://www.evolutionnext.com http://www.abqjug.org

jerryyanmj commented 12 years ago

I had the same issue, but I resolved it by doing the following. addSbtPlugin("play" % "sbt-plugin" % Option(System.getProperty("play.version")).getOrElse("2.0-RC2"))