1

I have an IntelliJ Idea project that uses external libraries. I cannot find one of this libraries in the ~/.ivy2/cache directory. The sbt file looks like:

name := "myproject"
scalaVersion := "2.11.8"
lazy val toImport = RootProject(uri("someuri#hash"))
lazy val root = (project in file(".")).dependsOn(toImport)

IntelliJ Idea underlines the toImport line saying that it cannot find it. How can I solve this?

Justin Kaeser
  • 5,868
  • 27
  • 46
user1868607
  • 2,558
  • 1
  • 17
  • 38
  • Have you tried updating from command line? "sbt update; sbt updateClassifiers; sbt updateSbtClassifiers" – motilio Aug 02 '17 at 18:36
  • @motilio yes i tried but nothing happens im trying to compile the source and use the jar but sbt package does not work – user1868607 Aug 02 '17 at 19:23
  • look at this https://stackoverflow.com/questions/9441441/how-to-set-up-an-intellij-idea-scala-project-to-recognize-local-ivy2-cache?rq=1 – motilio Aug 02 '17 at 19:25

1 Answers1

1

If you mean the RootProject is highlighted red, it seem you've run into a problem with how IDEA imports transitive modules. I've reproduced this with the information from your other question and created an issue on the Scala plugin issue tracker: https://youtrack.jetbrains.com/issue/SCL-12355

To work around this problem, one "fix" is to manually rename the modules in project structure to this:

enter image description here

... but that will get lost after refreshing the project from sbt.

Instead, I suggest you enable the "use sbt for build and import" in the sbt options. You will have the highlighting error, but builds will work fine.

Justin Kaeser
  • 5,868
  • 27
  • 46