IntelliJ Idea错误:sbt.InvalidComponent:无法检索源模块:org.scala-sbt:compiler-interface:0.13.5:component

时间:2016-10-12 08:27:32

标签: scala intellij-idea sbt

我正在尝试使用IntelliJ构思导入Scala项目,但它失败并带有

sbt.InvalidComponent:无法检索源模块:org.scala-sbt:compiler-interface:0.13.5:component

sbt.last.log 的全部内容为:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0
[info] Loading project definition from /Users/grega/dev/mab/ads/project/project
[info] Loading project definition from /Users/grega/dev/mab/shared/scala/common-build-plugin/project
[info] Loading project definition from /Users/grega/dev/mab/ads/project
[info] Compiling 2 Scala sources to /Users/grega/dev/mab/shared/scala/common-build-plugin/target/scala-2.10/sbt-0.13/classes...
[info] Attempting to fetch org.scala-sbt % compiler-interface % 0.13.5. This operation may fail.
[info] Resolving org.scala-sbt#compiler-interface;0.13.5 ...
[info] Resolving org.scala-lang#scala-library;2.10.4 ...
[info] Resolving org.scala-sbt#interface;0.13.5 ...
[warn]  [FAILED     ] org.scala-sbt#compiler-interface;0.13.5!compiler-interface.jar(src):  (0ms)
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.5/srcs/compiler-interface-sources.jar
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/compiler-interface/0.13.5/srcs/compiler-interface-sources.jar
[warn] ==== local: tried
[warn]   /Users/grega/.ivy2/local/org.scala-sbt/compiler-interface/0.13.5/srcs/compiler-interface-sources.jar
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/0.13.5/compiler-interface-0.13.5-sources.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scala-sbt#compiler-interface;0.13.5!compiler-interface.jar(src)
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.InvalidComponent: Couldn't retrieve source module: org.scala-sbt:compiler-interface:0.13.5:component
    at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1$$anonfun$apply$2$$anonfun$apply$mcV$sp$1.apply(ComponentCompiler.scala:124)
    at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1$$anonfun$apply$2$$anonfun$apply$mcV$sp$1.apply(ComponentCompiler.scala:117)
    at sbt.IO$.withTemporaryDirectory(IO.scala:344)
    at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1$$anonfun$apply$2.apply$mcV$sp(ComponentCompiler.scala:117)
    at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1$$anonfun$apply$2.apply(ComponentCompiler.scala:117)
    at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1$$anonfun$apply$2.apply(ComponentCompiler.scala:117)
    at sbt.BufferedLogger.bufferQuietly(BufferedLogger.scala:31)
    at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1.apply(ComponentCompiler.scala:115)
    at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1.apply(ComponentCompiler.scala:110)
    at sbt.IO$.withTemporaryDirectory(IO.scala:344)
    at sbt.compiler.IvyComponentCompiler.sbt$compiler$IvyComponentCompiler$$compileAndInstall(ComponentCompiler.scala:110)
    at sbt.compiler.IvyComponentCompiler$$anonfun$apply$1.apply$mcV$sp(ComponentCompiler.scala:101)
    at sbt.IfMissing$Define.apply(ComponentManager.scala:75)
    at sbt.ComponentManager.sbt$ComponentManager$$createAndCache$1(ComponentManager.scala:39)
    at sbt.ComponentManager$$anonfun$sbt$ComponentManager$$fromGlobal$1$1.apply(ComponentManager.scala:27)
    at sbt.ComponentManager$$anonfun$sbt$ComponentManager$$fromGlobal$1$1.apply(ComponentManager.scala:26)
    at sbt.ComponentManager$$anon$1.call(ComponentManager.scala:50)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
    at xsbt.boot.Using$.withResource(Using.scala:10)
    at xsbt.boot.Using$.apply(Using.scala:9)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.ComponentManager.lock(ComponentManager.scala:50)
    at sbt.ComponentManager.lockGlobalCache(ComponentManager.scala:49)
    at sbt.ComponentManager.sbt$ComponentManager$$fromGlobal$1(ComponentManager.scala:25)
    at sbt.ComponentManager$$anonfun$files$1$$anonfun$apply$2.apply(ComponentManager.scala:44)
    at sbt.ComponentManager$$anonfun$files$1$$anonfun$apply$2.apply(ComponentManager.scala:44)
    at sbt.ComponentManager.sbt$ComponentManager$$getOrElse$1(ComponentManager.scala:32)
    at sbt.ComponentManager$$anonfun$files$1.apply(ComponentManager.scala:44)
    at sbt.ComponentManager$$anonfun$files$1.apply(ComponentManager.scala:44)
    at sbt.ComponentManager$$anon$1.call(ComponentManager.scala:50)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
    at xsbt.boot.Using$.withResource(Using.scala:10)
    at xsbt.boot.Using$.apply(Using.scala:9)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.ComponentManager.lock(ComponentManager.scala:50)
    at sbt.ComponentManager.lockLocalCache(ComponentManager.scala:47)
    at sbt.ComponentManager.files(ComponentManager.scala:44)
    at sbt.ComponentManager.file(ComponentManager.scala:53)
    at sbt.compiler.IvyComponentCompiler.apply(ComponentCompiler.scala:101)
    at sbt.compiler.ComponentCompiler$$anon$2.apply(ComponentCompiler.scala:35)
    at sbt.compiler.AnalyzingCompiler.loader(AnalyzingCompiler.scala:112)
    at sbt.compiler.AnalyzingCompiler.getInterfaceClass(AnalyzingCompiler.scala:117)
    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:98)
    at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:56)
    at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:51)
    at sbt.compiler.CompilerCache$$anon$2.apply(CompilerCache.scala:47)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:39)
    at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:50)
    at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
    at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
    at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:74)
    at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:49)
    at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:64)
    at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
    at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
    at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:68)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:67)
    at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:95)
    at sbt.inc.Incremental$.compile(Incremental.scala:67)
    at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
    at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
    at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
    at sbt.Compiler$.compile(Compiler.scala:152)
    at sbt.Compiler$.compile(Compiler.scala:138)
    at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:860)
    at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:851)
    at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:849)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] ({file:/Users/grega/dev/mab/shared/scala/common-build-plugin/}mab-common-build/compile:compileIncremental) sbt.InvalidComponent: Couldn't retrieve source module: org.scala-sbt:compiler-interface:0.13.5:component

我很确定这是一个IntelliJ想法问题,因为在使用纯SBT时(例如sbt compile),所有内容都会编译。下载Scala Incremental编译器(编译器接口)时似乎访问了错误的路径。

我正在使用:

  • 最新的IntelliJ Idea CE,v2016.2.4(build 162.2032.8)
  • 和Scala插件v2016.2.1.33

2 个答案:

答案 0 :(得分:2)

似乎Scala插件版本已损坏。手动下载Scala插件v2016.2.0(与IntelliJ Idea 2016.2.1 Build#IC-162.1447.26一起)似乎解决了这个问题。

答案 1 :(得分:0)

下载sbt launcher 0.13.5,然后在导入项目时将其设置为自定义启动器。