sbt auto-import doesn't include new libraryDependencies in module dependencies?

Hi,

I imported my project from sbt, and I checked `auto-import`. Now I added a `libraryDependency` to `build.sbt`, and I can see that IntelliJ is refreshing the project and resolving that particular dependency. But somehow it doesn't get added to the main module's dependencies.

For example, this shows the line hightlighted that I added:

Screenshot from 2014-12-13 13:54:17.png
So I should end up with `scalacolliderugens-spec` being added to the main project module, right? If afterwards I open the module settings, it is missing:

Screenshot from 2014-12-13 13:54:57.png
I only the see the old dependencies, where `scalacolliderugens-api` and `-core` are transitive dependencies from `scalacollider`, but the new dependency `scalacolliderugens-spec` is not there, and consequently it's missing on the classpath when running my project.

How would I work around this and make IntelliJ add that dependency? Do I have to remove the .idea files and re-import the project, or is there a faster trick?

Thanks!

__Edit__: The "insert image" function of the forum seems broken. I am attaching the images as files again.



Attachment(s):
Screenshot from 2014-12-13 13:54:57.png
Screenshot from 2014-12-13 13:54:17.png
2 comments
Comment actions Permalink

Ok, now I close and re-open the project, and I see an sbt error:

SBT 'Mutagen' project refresh failed
Error:[info] Loading global plugins from /home/hhrutz/.sbt/0.13/plugins
[info] Loading project definition from /home/hhrutz/Documents/devel/Mutagen/project
[info] Set current project to Mutagen (in build file:/home/hhrutz/Documents/devel/Mutagen/)
[info] Defining *:artifactPath
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to Mutagen (in build file:/home/hhrutz/Documents/devel/Mutagen/)
[info] Defining *:artifactClassifier
[info] The new value will be used by compile:packageBin::artifact, compile:packageDoc::artifact and 3 others.
[info]     Run `last` for details.
[info] Reapplying settings...
[info] Set current project to Mutagen (in build file:/home/hhrutz/Documents/devel/Mutagen/)
[info] Applying State transformations org.jetbrains.sbt.ReadProject from /home/hhrutz/.IdeaIC14/config/plugins/Scala/launcher/sbt-structure-0.13.jar
[info] Reading structure from /home/hhrutz/Documents/devel/Mutagen
[info] Updating {file:/home/hhrutz/Documents/devel/Mutagen/}mutagen...
[info] Resolving org.scala-lang#scala-library;2.11.4 ...
[info] Resolving de.sciss#scalacollider_2.11;1.15.0 ...
[info] Resolving de.sciss#scalaosc_2.11;1.1.3 ...
[info] Resolving de.sciss#scalaaudiofile_2.11;1.4.3 ...
[info] Resolving de.sciss#serial_2.11;1.0.2 ...
[info] Resolving de.sciss#processor_2.11;0.3.0 ...
[info] Resolving de.sciss#model_2.11;0.3.2 ...
[info] Resolving de.sciss#scalacolliderugens-core_2.11;1.12.0 ...
[info] Resolving de.sciss#scalacolliderugens-api_2.11;1.12.0 ...
[info] Resolving de.sciss#numbers_2.11;0.1.1 ...
[info] Resolving org.scala-lang.modules#scala-xml_2.11;1.0.2 ...
[info] Resolving de.sciss#scalacolliderugens-spec_2.11;1.12.0 ...
[info] Resolving de.sciss#scalacolliderugens-spec_2.11;1.12.0 ...
[warn]     module not found: de.sciss#scalacolliderugens-spec_2.11;1.12.0
[warn] ==== local: tried
[warn]   /home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-spec_2.11/1.12.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/de/sciss/scalacolliderugens-spec_2.11/1.12.0/scalacolliderugens-spec_2.11-1.12.0.pom
[info] Resolving de.sciss#strugatzki_2.11;2.7.0 ...
[info] Resolving de.sciss#span_2.11;1.2.1 ...
[info] Resolving de.sciss#intensitypalette;1.0.0 ...
[info] Resolving de.sciss#fileutil_2.11;1.1.1 ...
[info] Resolving com.github.scopt#scopt_2.11;3.2.0 ...
[info] Resolving de.sciss#topology_2.11;1.0.0-SNAPSHOT ...
[info] Resolving de.sciss#topology_2.11;1.0.0-SNAPSHOT ...
[info] Resolving org.scala-lang#scala-compiler;2.11.4 ...
[info] Resolving org.scala-lang#scala-reflect;2.11.4 ...
[info] Resolving org.scala-lang.modules#scala-parser-combinators_2.11;1.0.2 ...
[info] Resolving jline#jline;2.12 ...
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     ::          UNRESOLVED DEPENDENCIES         ::
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     :: de.sciss#scalacolliderugens-spec_2.11;1.12.0: not found
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]     Note: Unresolved dependencies path:
[warn]         de.sciss:scalacolliderugens-spec_2.11:1.12.0 (/home/hhrutz/Documents/devel/Mutagen/build.sbt#L25-31)
[warn]           +- de.sciss:mutagen_2.11:0.1.0-SNAPSHOT
sbt.ResolveException: unresolved dependency: de.sciss#scalacolliderugens-spec_2.11;1.12.0: not found
...

So I accidentally used `%% libVersion` instead of `% libVersion` required in this case.

So the bug is actually that IntelliJ doesn't tell me it can't find the dependency while live-refreshing.

0
Comment actions Permalink

Hi! Thanks for the report. I've created issue on Youtrack (https://youtrack.jetbrains.com/issue/SCL-8046) so you can track progress of resolving this problem.

0

Please sign in to leave a comment.