global installation for sbt 0.11.0 fails for me #95

Closed
bartschuller opened this Issue Sep 27, 2011 · 27 comments

6 participants

@bartschuller

I've been using the plugin with sbt 0.10.1 and earlier. When I upgraded sbt to 0.11.0 and also upgraded the plugin using the new instructions, the plugin wasn't active.

Specifically, with just ~/.sbt/plugins.sbt the file is read by sbt (syntax errors will trip it up), but gen-idea is not available. Moving the same contents to ~/.sbt/plugins/build.sbt however works.

Do the 0.11 instructions work for others? If so, then I guess sbt switches to some 0.10.x compatibility mode for me.

@mpeltonen
Owner

Yes, it works for me at least. Just tried with a clean ~/.sbt/ dir and project.

Howewer, I think have noticed some random weirdness in the past when having defined plugins in both plugins.sbt and plugins/build.sbt, but I'm not sure what and how it was fixed...

One thing you could try is to delete all target/ -dirs under ~/.sbt/ and project_dir/project. That has solved some of my plugin loading issues in the past.

@mpeltonen
Owner

Hmm, just noticed that if I have an (even empty) project/plugins -directory in the current project, then plugins in ~/sbt/plugins.sbt are not loaded...

@mpeltonen
Owner

Which seems to be actually the documented way: "The 0.10-style project/plugins/ is still supported. If
project/plugins/ exists, the 0.10 style is used and the 0.11 style is not.". See: https://groups.google.com/d/msg/simple-build-tool/ep_63fA_Gzk/i3hjlhNpg5kJ

Could this be your case?

@bartschuller

I guess, because I indeed have it working now in a project without project_dir/project/plugins/ directory.

Thanks.

@mpeltonen
Owner

Great. I need to note this in readme.

@bartschuller

OK. It gets weirder.

I can now consistently reproduce the following:

mkdir bla
cd bla
sbt

will not result in global plugins being loaded, sbt doesn't say "Updating".

mkdir bla
cd bla
mkdir project
touch projact/plusings.sbt
sbt

makes sbt realise what it needs to do, it says "Updating" and "done updating" and global plugins are available.

Time to mail this to the sbt list.

@bartschuller

It turns out the mention of ~/.sbt/plugins.sbt was wrong:

Sorry, that should be ~/.sbt/plugins/build.sbt. I fixed it.

-Mark

@mpeltonen
Owner

Ok, thanks! I need to update the readme.

@raicesg

For some reason gen-idea only creates the folders .dea, and .idea_modules but none of the project folders. Also, when I execute gen-idea sbt warns of failed downloads. Whats the issue????
FYI im using sbt 0.11.....

@mpeltonen
Owner

What do you mean by 'project folders'?

gen-idea creates only .idea and .idea_modules dirs, which contain the (module) configuration for idea. You should have already created your 'project folders' by yourself.

Warnings come because ivy can't find sources and javadocs for every artifact, so these are 'normal' warnings.

@raicesg

Sorry I just started using the plugin earlier today and when I used it with the older version of sbt 0.7.7 it created the whole project structure for me with the command >idea.

@mpeltonen
Owner

The 0.10/0.11 version shouldn't differ from 0.7 in this regard, i.e. you should get Idea modules for all of your (sub)projects in current sbt project (i.e. the whole project structure)? Or am I still missing something?

@benjaminparker

I've just upgraded to IDEA 11, and am using sbt 0.11 and am trying to gen project files. I get this issue

[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: commons-codec#commons-codec;1.2!commons-codec.jar(src)
[warn] :: org.scala-tools.testing#test-interface;0.5!test-interface.jar(src)
[warn] :: org.scala-tools.sbt#compiler-interface;0.11.0!compiler-interface.jar(src)

Can I disable the downloading of sources for the plugin ?

@benjaminparker

Apologies - I see you already answered this above. Think my issues are more with early access IDEA than the plugin

@raicesg

What I meant by project structure was the creation of the /src/... I found a utility g8 that creates your project folders based on the type of project you will creating. I have read that this option was taken out of sbt 0.11.0 on purpose.

@raicesg

Can anyone tell me why the scala-swing library want download.

libraryDependencies ++= Seq(
"org.scala-lang" % "scala-swing" % "2.9.1"
)

resolvers += "Scala-Tools Maven2 Snapshots Repository" at "http://scala-tools.org/repo-releases"

[info] Trying to create an Idea module default-a2ab00
[warn] [NOT FOUND ] org.scala-lang#scala-swing;2.9.1!scala-swing.jar(doc) (186ms)
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-lang/scala-swing/2.9.1/scala-swing-2.9.1-javadoc.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-swing;2.9.1!scala-swing.jar(doc)
[warn] ::::::::::::::::::::::::::::::::::::::::::::::

@mpeltonen
Owner

sbt-idea by default runs sbt's update with classifiers, i.e. sbt tries to download default classifiers (-javadoc.jar, -sources.jar) for every single dependency, transitively.

If no sources or javadocs can be found for a dependency, it notifies (warns) the user with those "FAILED DOWNLOAD" messages.

I.e. this is perfectly normal behavior (no javadoc in repo for scala-swing), but admittetly a bit verbose way to notify about that.

@raicesg
@mpeltonen
Owner

You can't because there is no javadoc for scala-swing in repo, only binary and sources: http://repo1.maven.org/maven2/org/scala-lang/scala-swing/2.9.1/

@mpeltonen
Owner

Just to make sure, did you notice, that the failed download was only for javadoc? The main (code) jar for scala-swing was probably downloaded just fine.

@tonit

Version sbt-idea 0.11.0 produces idea files that are not recognized by latest Nika UI 110.187 IntelliJ version (Project-Open does not work because IntelliJ does not find any idea descriptor).
This may be an IntelliJ bug, but also could be this plugin needs a fix. (haven't looked at it yet. Just saying)

thx!

@bartschuller

Dear people who find new issues with sbt-idea:

I'm guessing you wound up here through a google search. Great! you've found the right place, the github issue tracker for sbt-idea.

If your issue is "how to install sbt-idea globally" then perhaps this page contains the info you need.

If you have a different issue, then please scroll to the top of the page and click "New issue". This makes it easier for the maintainer to respond to your issue and it makes it easier for others who experience the same thing to find the correct page.

Thank you.

@pawelprazak

I have a problem after installing sbt 0.11.1.

my ~/.sbt/plugins/build.sbt looks like this:

resolvers += Classpaths.typesafeResolver

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse" % "1.4.0")

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

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

but i get whis error:

...
[warn] module not found: com.github.mpeltonen#sbt-idea;0.11.0
[warn] ==== local: tried
[warn] /home/pawel/.ivy2/local/com.github.mpeltonen/sbt-idea/scala_2.9.1/sbt_0.11.1/0.11.0/ivys/ivy.xml
[warn] ==== Maven2 Local: tried
[warn] file:/home/pawel/.m2/repository/com/github/mpeltonen/sbt-idea_2.9.1_0.11.1/0.11.0/sbt-idea-0.11.0.pom
[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.1/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.1/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.1/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.1, scalaVersion=2.9.1)
[warn]
[error] {file:/home/pawel/Dropbox/src/scala/swing-actor-binding/}default-565123/*:update-sbt-classifiers: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.0: not found
[info] Created /home/pawel/Dropbox/src/scala/swing-actor-binding/.idea_modules/project.iml

@mpeltonen
Owner

see: #110

@pawelprazak

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

and sbt gen-idea I get:
[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.1, scalaVersion=2.9.1)
[warn]
[error] {file:/home/pawel/Dropbox/src/scala/swing-actor-binding/}default-565123/*:update-sbt-classifiers: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.1-SNAPSHOT: not found

when i try sbt gen-idea no-sbt-classifiers I get:
[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.1, scalaVersion=2.9.1)
[warn]
[error] {file:/home/pawel/Dropbox/src/scala/swing-actor-binding/}default-565123/*:update-sbt-classifiers: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.1-SNAPSHOT: not found
[info] Created /home/pawel/Dropbox/src/scala/swing-actor-binding/.idea_modules/project.iml
[error] Not a valid command: no-sbt-classifiers
[error] Not a valid project ID: no-sbt-classifiers
[error] Not a valid configuration: no-sbt-classifiers
[error] Not a valid key: no-sbt-classifiers (similar: update-sbt-classifiers, transitive-classifiers, update-classifiers)
[error] no-sbt-classifiers
[error]

with:
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.1")
and sbt gen-idea I get:
[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.1, scalaVersion=2.9.1)
[warn]
[error] {file:/home/pawel/.sbt/plugins/}default-79d552/*:update: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.1: not found

when i try sbt gen-idea no-sbt-classifiers I get:
[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.1, scalaVersion=2.9.1)
[warn]
[error] {file:/home/pawel/.sbt/plugins/}default-79d552/*:update: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.1: not found

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

and sbt gen-idea I get:
[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.1, scalaVersion=2.9.1)
[warn]
[error] {file:/home/pawel/Dropbox/src/scala/swing-actor-binding/}default-565123/*:update-sbt-classifiers: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.0: not found

when i try sbt gen-idea no-sbt-classifiers I get:
[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.1, scalaVersion=2.9.1)
[warn]
[error] {file:/home/pawel/Dropbox/src/scala/swing-actor-binding/}default-565123/*:update-sbt-classifiers: sbt.ResolveException: unresolved dependency: com.github.mpeltonen#sbt-idea;0.11.0: not found
[info] Created /home/pawel/Dropbox/src/scala/swing-actor-binding/.idea_modules/project.iml
[error] Not a valid command: no-sbt-classifiers
[error] Not a valid project ID: no-sbt-classifiers
[error] Not a valid configuration: no-sbt-classifiers
[error] Not a valid key: no-sbt-classifiers (similar: update-sbt-classifiers, transitive-classifiers, update-classifiers)
[error] no-sbt-classifiers
[error]

@mpeltonen
Owner

no-sbt-classifiers command parameter does not work from the command line as-is. Start sbt command prompt first (just 'sbt') and then on sbt command prompt say 'gen-idea no-sbt-classifiers'.

I'm not sure if quoting command and parameter would work from the command line: sbt 'gen-idea no-sbt-classifiers'

@pawelprazak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment