sbt 无法为 scala 版本 2.11.12 创建 jar
Posted
技术标签:
【中文标题】sbt 无法为 scala 版本 2.11.12 创建 jar【英文标题】:sbt unable to create jar for scala version 2.11.12 【发布时间】:2020-05-30 02:34:54 【问题描述】:我正在尝试使用 intellij IDE(2019.3.2 社区版)中的 scala 和 sbt 构建工具(版本 1.3.8)为简单的 hello world 项目创建 .jar 文件。对于 scala 版本 2.13.1,我可以毫无问题地做到这一点。但是当我将其更改为 2.11.12 时,sbt 包因以下错误而中断。 我也想在这个项目中添加 spark-core 依赖项。所以我必须使用 2.11.12 版本,因为 2.13.1 没有兼容的版本。 请帮我解决这个错误。
[info] 从 C:\Users\username.sbt\1.0\plugins 加载全局插件 [信息] 从加载项目定义 C:\Users\username\IdeaProjects\scalawithsbt\project [信息] 来自 build.sbt 的项目 scalawithsbt 的设置 ... [信息] 设置 当前项目到 scalawithsbt(在构建中 file:/C:/Users/username/IdeaProjects/scalawithsbt/) [信息] 编译 1 Scala 源代码 C:\Users\用户名\IdeaProjects\scalawithsbt\target\scala-2.11\classes ... 2020 年 2 月 14 日 11:48:15 lmcoursier.internal.shaded.coursier.cache.shaded.org.jline.utils.Log logr WARNING: 无法创建系统终端,创建一个哑巴 终端(启用调试日志以获取更多信息)[信息]尝试 获取 org.scala-sbt:compiler-bridge_2.11:1.3.4。 [信息] 更新 [info] Resolved dependencies [error] ## 编译时出现异常 1 来源 C:\Users\用户名\IdeaProjects\scalawithsbt\target\scala-2.11\classes [错误] sbt.internal.inc.InvalidComponent:编译器桥源 CoursierModuleDescriptor(ModuleDescriptorConfiguration(假,无, org.scala-sbt.temp:temp-module-518b91374cbcb06003d475b7704c2316602396eb:1.3.4:co 堆积, ModuleInfo(temp-module-518b91374cbcb06003d475b7704c2316602396eb, , 无,无,矢量(),,无,无,矢量()), Vector(org.scala-sbt:compiler-bridge_2.11:1.3.4:compile), Vector(), Vector(), , Vector(compile, run ntime, test, provided, optional), Some(compile), ConflictManager(latest-revision, *, *)),CoursierConfiguration(一些(sbt.internal.util.ManagedLogger@7306a11a), 矢量(原始(ProjectResolver(项目间,映射:org.scala- sbt#global-plugins;0.0)),公共:https://repo1.maven.org/maven2/, 文件存储库(本地, Patterns(ivyPatterns=Vector(///C:/Users/username/.ivy2//local/[组织]/[模块]/(scala_[scalaVersion]/)(sbt_[sbtVersio n]/)([branch]/)[revision]/[type]s/artifact.[ext]), artifactPatterns=Vector(///C:/Users/username/.ivy2//local/[组织]/[模块]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision ] /[type]s/artifact.[ext]), isMavenCompatible=false, 描述符可选=假,skipConsistencyCheck=假), FileConfiguration(true, None)), URLRepository(sbt-plugin-releases, 模式(ivyPatterns=矢量(h ttps://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision ]/[type]s/artifact.[ext]), artifactPatterns=矢量(https://re po.scala-sbt.org/scalasbt/sbt-plugin-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision]/[type ]s/artifact.[ext]), isMavenCompatible=false, 描述符可选 =false,skipConsistencyCheck=false),false),URLRepository(typesafe-alt-ivy-releases, 模式(ivyPatterns=矢量(https://repo.typesafe.com/typesafe/ivy-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtV ersion]/)([branch]/)[revision]/[type]s/artifact.[ext]), artifactPatterns=矢量(https://repo.typesafe.com/typesafe/ivy-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch ]/)[revision]/[type]s/artifact.[ext]), isMavenCompatible=false,descriptorOptional=false, skipConsistencyCheck=false), false), sbt-maven-releases: https://repo.scala-sbt.org/scalasbt/maven-releases/,某人 t-maven 快照: https://repo.scala-sbt.org/scalasbt/maven-snapshots/, URLRepository(typesafe-ivy-releases, 模式(ivyPatterns=矢量(https://repo.typesafe.com/typesafe/ivy-releases/[organization]/[module]/[revision ]/[type]s/artifact.[ext]), artifactPatterns=Vector(https://repo.typesafe.com/typesafe/ivy-releases/[organization]/[module]/[revision]/[type]s/artifact.[ext]), isMavenCompatible=false,d escriptorOptional=false, skipConsistencyCheck=false), false), URLRepository(sbt-ivy-snapshots, 模式(ivyPatterns=矢量(https://repo.scala-sbt.org/scalasbt/ivy-snapshots/[organization]/[module]/[revision]/[type]s/ar tifact.[ext]), artifactPatterns=Vector(https://repo.scala-sbt.org/scalasbt/ivy-snapshots/[organization]/[module]/[revision]/[type]s/artifact.[ext]), isMavenCompatible=false,descriptorOptional=false, skipConsistencyCheck=false), false)), 6, 100, Some(org.scala-lang), 一些(2.12.10), 向量(C:\Users\username.sbt\boot\scala-2.12.10\lib\jansi.jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\jline.jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\scala-compiler.jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\scala-library.jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\scala-reflect .jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\scala-xml_2.12.jar), 矢量(),矢量(),矢量(),真,假,矢量(),矢量(), 一些(org.scala-lang),一些(2.11.12),矢量(),矢量(),无, 一些(C:\Users\ username\AppData\Local\Coursier\cache\v1), 一些(C:\Users\username.ivy2),无,无,矢量(),矢量(), Vector((ModuleMatchers(Set(), Set(), true),Relaxed)), true)) 不能 被取回。 [错误] [错误] 注意:未解决的依赖关系 路径:[错误] sbt.internal.inc.ZincLMHelper$.update(ZincComponentCompiler.scala:293) [错误] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3(ZincComponentCompiler.scala:257) [错误] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3$adapted(ZincComponentCompiler.scala:250) [错误] sbt.io.IO$.withTemporaryDirectory(IO.scala:489) [错误] sbt.io.IO$.withTemporaryDirectory(IO.scala:499) [错误] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$2(ZincComponentCompiler.scala:250) [错误] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) [错误] sbt.internal.util.BufferedLogger.bufferQuietly(BufferedLogger.scala:119) [错误] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1(ZincComponentCompiler.scala:250) [错误] sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1$adapted(ZincComponentCompiler.scala:247) [错误] sbt.io.IO$.withTemporaryDirectory(IO.scala:489) [错误] sbt.io.IO$.withTemporaryDirectory(IO.scala:499) [错误] sbt.internal.inc.ZincComponentCompiler.compileAndInstall(ZincComponentCompiler.scala:247) [错误] sbt.internal.inc.ZincComponentCompiler.$anonfun$compiledBridgeJar$1(ZincComponentCompiler.scala:215) [错误] sbt.internal.inc.IfMissing$Define.run(IfMissing.scala:19) [错误] sbt.internal.inc.ZincComponentManager.createAndCache$1(ZincComponentManager.scala:49) [错误] sbt.internal.inc.ZincComponentManager.$anonfun$files$3(ZincComponentManager.scala:60) [错误] sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:42) [错误] sbt.internal.inc.ZincComponentManager.$anonfun$files$2(ZincComponentManager.scala:60) [错误] sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:89) [错误] xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95) [错误] xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80) [错误] xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99) [错误] xsbt.boot.Using$.withResource(Using.scala:10) [错误] xsbt.boot.Using$.apply(Using.scala:9) [错误] xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60) [错误] xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50) [错误] xsbt.boot.Locks$.apply0(Locks.scala:31) [错误] xsbt.boot.Locks$.apply(Locks.scala:28) [错误] sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:89) [错误] sbt.internal.inc.ZincComponentManager.$anonfun$lockSecondaryCache$1(ZincComponentManager.scala:86) [错误] scala.Option.map(Option.scala:230) [错误] sbt.internal.inc.ZincComponentManager.lockSecondaryCache(ZincComponentManager.scala:86) [错误] sbt.internal.inc.ZincComponentManager.fromSecondary$1(ZincComponentManager.scala:58) [错误] sbt.internal.inc.ZincComponentManager.$anonfun$files$6(ZincComponentManager.scala:64) [错误] sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:42) [错误] sbt.internal.inc.ZincComponentManager.$anonfun$files$5(ZincComponentManager.scala:64) [错误] sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:89) [错误] xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95) [错误] xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80) [错误] xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99) [错误] xsbt.boot.Using$.withResource(Using.scala:10) [错误] xsbt.boot.Using$.apply(Using.scala:9) [错误] xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60) [错误] xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50) [错误] xsbt.boot.Locks$.apply0(Locks.scala:31) [错误] xsbt.boot.Locks$.apply(Locks.scala:28) [错误] sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:89) [错误] sbt.internal.inc.ZincComponentManager.lockLocalCache(ZincComponentManager.scala:82) [错误] sbt.internal.inc.ZincComponentManager.files(ZincComponentManager.scala:64) [错误] sbt.internal.inc.ZincComponentManager.file(ZincComponentManager.scala:70) [错误] sbt.internal.inc.ZincComponentCompiler.compiledBridgeJar(ZincComponentCompiler.scala:215) [错误] sbt.internal.inc.ZincComponentCompiler$ZincCompilerBridgeProvider.compiledBridge(ZincComponentCompiler.scala:75) [错误] sbt.internal.inc.ZincComponentCompiler$ZincCompilerBridgeProvider.fetchCompiledBridge(ZincComponentCompiler.scala:81) [错误] sbt.internal.inc.AnalyzingCompiler.loader(AnalyzingCompiler.scala:260) [错误] sbt.internal.inc.AnalyzingCompiler.getInterfaceClass(AnalyzingCompiler.scala:278) [错误] sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:245) [错误] sbt.internal.inc.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:145) [错误] sbt.internal.inc.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:132) [错误] sbt.internal.inc.FreshCompilerCache.apply(CompilerCache.scala:102) [错误] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:92) [错误] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:91) [错误] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) [错误] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:186) [错误] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82) [错误] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3$adapted(MixedAnalyzingCompiler.scala:77) [错误] sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:215) [错误] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:77) [错误] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:146) [错误] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:343) [错误] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:343) [错误] sbt.internal.inc.Incremental$.doCompile(Incremental.scala:120) [错误] sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:100) [错误] sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:180) [错误] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:98) [错误] sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:102) [错误] sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:155) [错误] sbt.internal.inc.Incremental$.compile(Incremental.scala:92) [错误] sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:75) [错误] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:348) [错误] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:301) [错误] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:168) [错误] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:248) [错误] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:74) [错误] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1762) [错误] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1735) [错误] scala.Function1.$anonfun$compose$1(Function1.scala:49) [错误] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62) [错误] sbt.std.Transform$$anon$4.work(Transform.scala:67) [错误] sbt.Execute.$anonfun$submit$2(Execute.scala:281) [错误] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19) [错误] sbt.Execute.work(Execute.scala:290) [错误] sbt.Execute.$anonfun$submit$1(Execute.scala:281) [错误] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178) [错误] sbt.CompletionService$$anon$2.call(CompletionService.scala:37) [错误] java.util.concurrent.FutureTask.run(FutureTask.java:266) [错误] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [错误] java.util.concurrent.FutureTask.run(FutureTask.java:266) [错误] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [错误] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [错误] java.lang.Thread.run(Thread.java:748) [错误] [错误] sbt.internal.inc.InvalidComponent:编译器桥源 CoursierModuleDescriptor(ModuleDescriptorConfiguration(假,无, org.scala-sbt.temp:temp-module-518b91374cbcb06003d475b7704c2316602396eb:1.3.4:co 堆积, ModuleInfo(temp-module-518b91374cbcb06003d475b7704c2316602396eb, , 无,无,矢量(),,无,无,矢量()), Vector(org.scala-sbt:compiler-bridge_2.11:1.3.4:compile), Vector(), Vector(), , Vector(compile, run ntime, test, provided, optional), Some(compile), ConflictManager(latest-revision, *, *)),CoursierConfiguration(一些(sbt.internal.util.ManagedLogger@7306a11a), 矢量(原始(ProjectResolver(项目间,映射:org.scala- sbt#global-plugins;0.0)),公共:https://repo1.maven.org/maven2/, 文件存储库(本地, Patterns(ivyPatterns=Vector(///C:/Users/username/.ivy2//local/[组织]/[模块]/(scala_[scalaVersion]/)(sbt_[sbtVersio n]/)([branch]/)[revision]/[type]s/artifact.[ext]), artifactPatterns=Vector(///C:/Users/username/.ivy2//local/[组织]/[模块]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision ] /[type]s/artifact.[ext]), isMavenCompatible=false, 描述符可选=假,skipConsistencyCheck=假), FileConfiguration(true, None)), URLRepository(sbt-plugin-releases, 模式(ivyPatterns=矢量(h ttps://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision ]/[type]s/artifact.[ext]), artifactPatterns=矢量(https://re po.scala-sbt.org/scalasbt/sbt-plugin-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision]/[type ]s/artifact.[ext]), isMavenCompatible=false, 描述符可选 =false,skipConsistencyCheck=false),false),URLRepository(typesafe-alt-ivy-releases, 模式(ivyPatterns=矢量(https://repo.typesafe.com/typesafe/ivy-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtV ersion]/)([branch]/)[revision]/[type]s/artifact.[ext]), artifactPatterns=矢量(https://repo.typesafe.com/typesafe/ivy-releases/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch ]/)[revision]/[type]s/artifact.[ext]), isMavenCompatible=false,descriptorOptional=false, skipConsistencyCheck=false), false), sbt-maven-releases: https://repo.scala-sbt.org/scalasbt/maven-releases/,某人 t-maven 快照: https://repo.scala-sbt.org/scalasbt/maven-snapshots/, URLRepository(typesafe-ivy-releases, 模式(ivyPatterns=矢量(https://repo.typesafe.com/typesafe/ivy-releases/[organization]/[module]/[revision ]/[type]s/artifact.[ext]), artifactPatterns=Vector(https://repo.typesafe.com/typesafe/ivy-releases/[organization]/[module]/[revision]/[type]s/artifact.[ext]), isMavenCompatible=false,d escriptorOptional=false, skipConsistencyCheck=false), false), URLRepository(sbt-ivy-snapshots, 模式(ivyPatterns=矢量(https://repo.scala-sbt.org/scalasbt/ivy-snapshots/[organization]/[module]/[revision]/[type]s/ar tifact.[ext]), artifactPatterns=Vector(https://repo.scala-sbt.org/scalasbt/ivy-snapshots/[organization]/[module]/[revision]/[type]s/artifact.[ext]), isMavenCompatible=false,descriptorOptional=false, skipConsistencyCheck=false), false)), 6, 100, Some(org.scala-lang), 一些(2.12.10), 向量(C:\Users\username.sbt\boot\scala-2.12.10\lib\jansi.jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\jline.jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\scala-compiler.jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\scala-library.jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\scala-reflect .jar, C:\Users\username.sbt\boot\scala-2.12.10\lib\scala-xml_2.12.jar), 矢量(),矢量(),矢量(),真,假,矢量(),矢量(), 一些(org.scala-lang),一些(2.11.12),矢量(),矢量(),无, 一些(C:\Users\ username\AppData\Local\Coursier\cache\v1), 一些(C:\Users\username.ivy2),无,无,矢量(),矢量(), Vector((ModuleMatchers(Set(), Set(), true),Relaxed)), true)) 不能 被取回。 [错误] [错误] 注意:未解决的依赖关系 路径:[错误]在 sbt.internal.inc.ZincLMHelper$.update(ZincComponentCompiler.scala:293) [错误] 在 sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3(ZincComponentCompiler.scala:257) [错误] 在 sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3$adapted(ZincComponentCompiler.scala:250) [错误] 在 sbt.io.IO$.withTemporaryDirectory(IO.scala:489) [错误] 在 sbt.io.IO$.withTemporaryDirectory(IO.scala:499) [错误] 在 sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$2(ZincComponentCompiler.scala:250) [错误] 在 scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) [错误] 在 sbt.internal.util.BufferedLogger.bufferQuietly(BufferedLogger.scala:119) [错误] 在 sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1(ZincComponentCompiler.scala:250) [错误] 在 sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1$adapted(ZincComponentCompiler.scala:247) [错误] 在 sbt.io.IO$.withTemporaryDirectory(IO.scala:489) [错误] 在 sbt.io.IO$.withTemporaryDirectory(IO.scala:499) [错误] 在 sbt.internal.inc.ZincComponentCompiler.compileAndInstall(ZincComponentCompiler.scala:247) [错误] 在 sbt.internal.inc.ZincComponentCompiler.$anonfun$compiledBridgeJar$1(ZincComponentCompiler.scala:215) [错误] 在 sbt.internal.inc.IfMissing$Define.run(IfMissing.scala:19) [错误] 在 sbt.internal.inc.ZincComponentManager.createAndCache$1(ZincComponentManager.scala:49) [错误] 在 sbt.internal.inc.ZincComponentManager.$anonfun$files$3(ZincComponentManager.scala:60) [错误] 在 sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:42) [错误] 在 sbt.internal.inc.ZincComponentManager.$anonfun$files$2(ZincComponentManager.scala:60) [错误] 在 sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:89) [错误] 在 xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95) [错误] 在 xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80) [错误] 在 xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99) [错误] 在 xsbt.boot.Using$.withResource(Using.scala:10) [错误] xsbt.boot.Using$.apply(Using.scala:9) [错误] 在 xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60) [错误] 在 xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50) [错误] xsbt.boot.Locks$.apply0(Locks.scala:31) [错误] 在 xsbt.boot.Locks$.apply(Locks.scala:28) [错误] 在 sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:89) [错误] 在 sbt.internal.inc.ZincComponentManager.$anonfun$lockSecondaryCache$1(ZincComponentManager.scala:86) [错误] 在 scala.Option.map(Option.scala:230) [错误] 在 sbt.internal.inc.ZincComponentManager.lockSecondaryCache(ZincComponentManager.scala:86) [错误] 在 sbt.internal.inc.ZincComponentManager.fromSecondary$1(ZincComponentManager.scala:58) [错误] 在 sbt.internal.inc.ZincComponentManager.$anonfun$files$6(ZincComponentManager.scala:64) [错误] 在 sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:42) [错误] 在 sbt.internal.inc.ZincComponentManager.$anonfun$files$5(ZincComponentManager.scala:64) [错误] 在 sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:89) [错误] 在 xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95) [错误] 在 xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80) [错误] 在 xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99) [错误] 在 xsbt.boot.Using$.withResource(Using.scala:10) [错误] xsbt.boot.Using$.apply(Using.scala:9) [错误] 在 xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60) [错误] 在 xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50) [错误] xsbt.boot.Locks$.apply0(Locks.scala:31) [错误] 在 xsbt.boot.Locks$.apply(Locks.scala:28) [错误] 在 sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:89) [错误] 在 sbt.internal.inc.ZincComponentManager.lockLocalCache(ZincComponentManager.scala:82) [错误] 在 sbt.internal.inc.ZincComponentManager.files(ZincComponentManager.scala:64) [错误] 在 sbt.internal.inc.ZincComponentManager.file(ZincComponentManager.scala:70) [错误] 在 sbt.internal.inc.ZincComponentCompiler.compiledBridgeJar(ZincComponentCompiler.scala:215) [错误] 在 sbt.internal.inc.ZincComponentCompiler$ZincCompilerBridgeProvider.compiledBridge(ZincComponentCompiler.scala:75) [错误] 在 sbt.internal.inc.ZincComponentCompiler$ZincCompilerBridgeProvider.fetchCompiledBridge(ZincComponentCompiler.scala:81) [错误] 在 sbt.internal.inc.AnalyzingCompiler.loader(AnalyzingCompiler.scala:260) [错误] 在 sbt.internal.inc.AnalyzingCompiler.getInterfaceClass(AnalyzingCompiler.scala:278) [错误] 在 sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:245) [错误] 在 sbt.internal.inc.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:145) [错误] 在 sbt.internal.inc.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:132) [错误] 在 sbt.internal.inc.FreshCompilerCache.apply(CompilerCache.scala:102) [错误] 在 sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:92) [错误] 在 sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:91) [错误] 在 scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) [错误] 在 sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:186) [错误] 在 sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82) [错误] 在 sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3$adapted(MixedAnalyzingCompiler.scala:77) [错误] 在 sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:215) [错误] 在 sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:77) [错误] 在 sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:146) [错误] 在 sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:343) [错误] 在 sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:343) [错误] 在 sbt.internal.inc.Incremental$.doCompile(Incremental.scala:120) [错误] 在 sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:100) [错误] 在 sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:180) [错误] 在 sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:98) [错误] 在 sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:102) [错误] 在 sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:155) [错误] 在 sbt.internal.inc.Incremental$.compile(Incremental.scala:92) [错误] 在 sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:75) [错误] 在 sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:348) [错误] 在 sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:301) [错误] 在 sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:168) [错误] 在 sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:248) [错误] 在 sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:74) [错误] 在 sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1762) [错误] 在 sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1735) [错误] 在 scala.Function1.$anonfun$compose$1(Function1.scala:49) [错误] 在
【问题讨论】:
请提供您的项目中有哪些依赖项和版本。堆栈跟踪也不完整[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49) [error] at
- 我怀疑它后面有什么东西。尝试不使用 IntelliJ 而是在命令行中使用 sbt 构建 jar,它很可能由于 Scala 2.13 而无法编译
对不起,我没有提到。我必须删除部分错误,因为它超过 30,000 个字符的限制。我正在使用sbt package
命令构建代码,并且出现上述错误。我尝试使用 intellij 按钮构建和运行,它工作正常,但我没有在目标位置看到 .jar 文件。 sbt 版本 - 1.3.8 scala 版本 - 2.11.12
你的 spark 版本是什么?
@rbcvl 我还没有在 build.sbt 中添加 spark。我首先尝试使用 2.11.12 版本构建 scala 代码并从中创建一个 jar 文件。这本身就是失败的。
“编译器桥源...无法检索”,它说。也许您在防火墙或代理后面?似乎类似于***.com/questions/47347713/…
【参考方案1】:
此问题已修复。 我在本地运行了两个版本的 java 8。 卸载旧版本后,我可以在 scala 版本之间切换并运行
sbt 包
并用它们创建罐子。
【讨论】:
以上是关于sbt 无法为 scala 版本 2.11.12 创建 jar的主要内容,如果未能解决你的问题,请参考以下文章
由于多个 scala lib 版本,intellij 2019.02 无法运行任何 scala 类
scala 使用的是二进制发行版附带的 akka,而不是 sbt 的发行版
sbt无法在项目中导入两个不同版本的elasticsearch库