IntelliJ Idea错误:sbt。InvalidComponent:无法检索源模块:org.scala-sbt:编译器接口:0.13.5:组件

时间:2023-02-08 23:13:14

I'm trying to Import a Scala project with IntelliJ idea and it fails with

我尝试导入一个带有IntelliJ idea的Scala项目,但是失败了。

sbt.InvalidComponent: Couldn't retrieve source module: org.scala-sbt:compiler-interface:0.13.5:component

sbt。InvalidComponent:无法检索源模块:org.scala-sbt:编译器接口:0.13.5:组件

The full contents of sbt.last.log is:

最后是sbt的全部内容。日志:

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

I'm pretty sure this is a IntelliJ idea problem, as everything compiles when using pure SBT (e.g. sbt compile). It seems to be accessing the wrong path when downloading Scala Incremental compiler (compiler-interface).

我很确定这是一个IntelliJ的概念问题,因为所有的东西都是在使用纯SBT(例如SBT编译)时编译的。在下载Scala增量编译器(编译器-接口)时,它似乎访问了错误的路径。

I am using:

我用:

  • the latest IntelliJ Idea CE, v2016.2.4 (build 162.2032.8)
  • 最新的IntelliJ Idea CE, v2016.2.4(构建162.2032.8)
  • and Scala plugin v2016.2.1.33
  • 和Scala插件v2016.2.1.33

2 个解决方案

#1


1  

It seems that Scala plugin version is broken. Manually downloading Scala plugin v2016.2.0 (together with IntelliJ Idea 2016.2.1 Build #IC-162.1447.26) seems to solve the problem.

看起来Scala插件的版本已经被打破了。手动下载Scala插件v2016.2.0(连同IntelliJ Idea 2016.2.1 Build #IC-162.1447.26)似乎解决了这个问题。

#2


0  

Download sbt launcher 0.13.5 and then set it as the custom launcher when importing the project.

下载sbt启动程序0.13.5,在导入项目时设置为自定义启动程序。

#1


1  

It seems that Scala plugin version is broken. Manually downloading Scala plugin v2016.2.0 (together with IntelliJ Idea 2016.2.1 Build #IC-162.1447.26) seems to solve the problem.

看起来Scala插件的版本已经被打破了。手动下载Scala插件v2016.2.0(连同IntelliJ Idea 2016.2.1 Build #IC-162.1447.26)似乎解决了这个问题。

#2


0  

Download sbt launcher 0.13.5 and then set it as the custom launcher when importing the project.

下载sbt启动程序0.13.5,在导入项目时设置为自定义启动程序。