Search code examples
intellij-ideasbtintellij-plugin

IntelliJ sbt unresolved dependencies


i have a scala sbt project imported in the IntelliJ 2019.1. Operate on the two independent computers:
- computer 1 with typical internet connection - let's call it "normal",
- computer 2 without internet connection - name it "blind".

On the 'normal' and 'blind' computer both IntelliJ and scala plugin with the same versions are being installed. When operating on 'normal' computer everything goes well - am able to compile, clean, assembly code from the IntelliJ sbt shell. When operating on 'blind' computer, I am not capable of build the project - get unresolved dependencies error in the sbt console. I have already moved the dependencies from ~/.sbt, ~/.ivy2, ~/.m2 directories from 'normal' to 'blind' computer also.

Error message:

[info] Loading settings from idea.sbt ... 
[info] Loading global plugin from /home/myuser/.sbt/1.0/plugins
[info] Updating {file:/home/tomaszk/.sbt/1.0/plugins/}global-plugins...
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] :: io.github.sugakandrey#scala-compiler-indices-protocol_2.12;0.1.1: Resolution failed several times for dependency: io.github.sugakandrey#scala-compiler-indices-protocol_2.12;0.1.1 {compile=[default(compile)]}
...
[error] sbt.librarymanagement.ResolveException: unresolved dependency: io.github.sugakandrey#scala-compiler-indices-protocol_2.12...

build.properties

sbt.version=1.0.3

build.sbt

name := "my_proj"
version := "1.0"

scalaVersion := "2.10.5"

libraryDependencies += "org.apache.spark" % "spark-core_2.10" % "1.6.3" % "provided"
libraryDependencies += "org.apache.spark" % "spark-sql_2.10" % "1.6.3" % "provided"
libraryDependencies += "joda-time" % "joda-time" % "2.10.1"
libraryDependencies += "com.databricks" % "spark-csv_2.10" % "1.5.0"
libraryDependencies += "com.typesafe" % "config" % "1.3.1"
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)
assemblyJarName in assembly := "my_proj.jar"

Shall i change the sbt version maybe or move another directories which sore some dependencies or the problem is related to the other issue?

This topis is a bit related to my previous question: Use Scala on computer without internet connection

  • TK

Solution

  • As @MarioGalic sugested, the problem was with the scala and sbt versions - had to downgrade the IntelliJ Scala Plugin from 2019.1.9 to 2019.1.3 to solve the issue.