Search code examples
scalaintellij-ideasbt-plugin

IntelliJ Idea Cannot find sbt-idea-compiler-indices


Installed IntelliJ Idea CE 2019.1 (on Win64, Windows 7 and 10, from zip) - and in both cases it cannot find the dependency shown below, so it cannot import an sbt project.

The project is valid, i.e. it compiles using sbt on the command line.

I am trying to import the project by opening build.sbt "as a project", something which usually works.

I am able to import this same project using Idea 2018.3 - so it sounds like something changed in the sbt plugin in 2019.1

I am working behind a firewall, but I have configured the proxy and checked that it can connect to outside repositories.

There is no mention of "sbt-idea-compiler-indices" in the log, and I see messages showing that Idea is downloading files from the outside.

sbt.librarymanagement.ResolveException: unresolved dependency: org.jetbrains#sbt-idea-compiler-indices;0.1.3: not found

Any idea what this means, or where I can find this dependency?

If all else fails, I could download the files manually and set them up under ~/.ivy2

[warn]          org.jetbrains:sbt-idea-compiler-indices:0.1.3 (scalaVersion=2.12, sbtVersion=1.0)
[warn]            +- org.scala-sbt:global-plugins:0.0 (scalaVersion=2.12, sbtVersion=1.0)

Solution

  • sbt-compiler-indices is an sbt plugin that is distributed with the IntelliJ Scala plugin. Usually it will be resolved from disk, but in some setups this fails, for example when starting sbt with the override.build.repos=true option. This should be fixed soon when it is added to the main sbt-plugin-releases repo.

    As a workaround, it should work if you start sbt from IntelliJ without the override.build.repos=true option once, so that the plugin can resolve into the cache.

    See also: https://youtrack.jetbrains.com/issue/SCL-15261