sbt project import problem
Hi
I have problems importing a Scala+Spark project in IDEA CE 2016.3 on macOS. When refreshing the sbt project IDEA cannot resolve dependencies. Commandine the project build just fine. All dependencies are locally available in Ivy cache.
I stripped down the problem to a very simple setup:
build.sbt:
name := "idea-sbt"
version := "1.0"
scalaVersion := "2.11.8"
libraryDependencies ++= Vector(
"org.apache.spark" %% "spark-core" % "2.0.2" ,
"org.apache.avro" % "avro" % "1.8.1"
)
project/build.properties:
sbt.version = 0.13.13
when refreshing the sbt project in IDEA I get following error:
Error:Error while importing SBT project:<br/>...<br/><pre>[info] Resolving org.spire-math#json4s-support_2.10;0.6.0 ...
[info] Resolving org.scala-sbt#run;0.13.13 ...
[info] Resolving org.scala-sbt#task-system;0.13.13 ...
[info] Resolving org.scala-sbt#tasks;0.13.13 ...
[info] Resolving org.scala-sbt#tracking;0.13.13 ...
[info] Resolving org.scala-sbt#cache;0.13.13 ...
[info] Resolving org.scala-sbt#testing;0.13.13 ...
[info] Resolving org.scala-sbt#test-agent;0.13.13 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-sbt#main-settings;0.13.13 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.13 ...
[info] Resolving org.scala-sbt#command;0.13.13 ...
[info] Resolving org.scala-sbt#template-resolver;0.1 ...
[info] Resolving org.scala-sbt#logic;0.13.13 ...
[info] Resolving org.scala-sbt#compiler-interface;0.13.13 ...
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.apache.spark#spark-core_2.11;2.0.2: not found
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.apache.spark#spark-core_2.11;2.0.2: not found
[error] Total time: 2 s, completed 24.01.2017 18:49:31</pre><br/>See complete log in <a href="/Users/c5254131/Library/Logs/IdeaIC2016.3/sbt.last.log">/Users/c5254131/Library/Logs/IdeaIC2016.3/sbt.last.log</a>
Strange thing is: If I comment out the Spark dependency in build.sbt, the refresh works fine.
Any ideas?
Klaus
Please sign in to leave a comment.
Could you attach the sbt.last.log from the link in the error message?
I can't reproduce the issue, but I do get warnings that some sources can't be resolved, so one thing to try is going to the sbt preferences in IntelliJ and disabling all the options under "Download:"
An update to this problem:
Seems like it has to to with our corporate http proxy. I just tried from home without setting the the http.proxy in the sbt VM parameters and then the refresh of the project works as expected.
Here is the sbt.last.log from the run with errors:
Thanks for the update! Indeed, IDEA doesn't currently pass the correct proxy settings to sbt. Here's the open issue: https://youtrack.jetbrains.com/issue/SCL-9856