我正在尝试在上安装sbt-eclipse,但在运行sbt
或sbt update
时,我一直收到以下错误。
错误
[info]从/home/atbyrd/.sbt/0.13/plugins加载全局插件[info]正在更新{file:/home/atbyrd/.sbt/0.13/plugins/}全局插件…〔信息〕正在解析org.scala-sbt#编译器接口;0.13.1…[警告]::::(警告)::
未解决的依赖关系::[警告]::::[警告]:org.scala-lang#scala库;2.10.3:在中找不到配置org.scala-lang#scala库;2.10.3:"编译"。它是从默认#全局插件;0.0提供[警告]::::,:::。ResolveException:未解析的依赖项:org.scala-lang#scala-library;2.10.3:在org.scala-lang#scala库中找不到配置;2.10.3:"编译"。它是从默认的#global-plugins;提供0.0在sbt。IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:213)位于sbt。IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)sbt。IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)sbt。IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:116)sbt。IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:116)sbt。IvySbt$$anonfun$withIvy$1.申请(Ivy.scala:104)sbt。IvySbt.sbt$IvySbt$$action$1(Ivy.scala:51)sbt。IvySbt$$anon$3。请致电(Ivy.scala:60)xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)位于xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:81)在xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)在xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)在xsbt.boot。使用$.withResource(使用.scala:11)xsbt.boot.使用$.apply(使用.scala:10)xsbt.boot.Locks$GlobalLock.withFileLock(Locks.scala:102)位于xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)位于xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)位于xsbt.boot.Locks$.apply0(Locks.scala:38)位于xsbt.boot.Locks$.apply(Locks.scala:28)位于sbt。IvySbt.withDefaultLogger(Ivy.scala:60)位于sbt。IvySbt与Ivy(Ivy.scala:101)在sbt。IvySt.withIvy(Ivy.scala:97)在sbt。IvySbt$Module.withModule(Ivy.scala:116)sbt。IvyActions$.update(IvyActions.scala:121)位于sbt。Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(默认值.scala:1161)在sbt。Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(默认值.scala:1159)在sbt。类路径$$anonfun$doWork$1$$anonfon$73.apply(默认值.scala:1182)在sbt。类路径$$anonfun$doWork$1$$anonfon$73.apply(默认值.scala:1180)在sbt。追踪$$anonfun$lastOutput$1.apply(追踪.scala:35)sbt。Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1184)位于sbt。Classpaths$$anonfun$doWork$1$1.apply(默认值.scala:1179)位于sbt。跟踪$$anonfun$inputChanged$1.apply(跟踪.scala:45)sbt。位于的类路径$.cachedUpdate(默认值.scala:1187)sbt。Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1152)位于sbt。位于的类路径$$anonfun$updateTask$1.apply(默认值.scala:1130)scala。函数$$anonfun$compose$1.apply(函数1.scala:47)sbt$波浪号$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)sbt.std.Transform$$anon$4.work(System.scala:64)sbt。执行$$anonfun$submit$$anonfon$apply$1.apply(执行.scala:237)在sbt。执行$$anonfun$submit$$anonfon$apply$1.apply(执行.scala:237)在sbt。ErrorHandling$.widConvert(ErrorHandling.scala:18)sbt。在执行.work(执行.scala:244)sbt。在执行$$anonfun$submit$1.apply(Execute.scala:237)sbt。在执行$$anonfun$submit$1.apply(Execute.scala:237)sbt。并发限制$$anon$4$$anonfun$1.apply(并发限制.scala:160)在sbt。CompletionService$$anon$2.调用(CompletionServices.scala:30)java.util.concurrent.FFutureTask.run(FutureTask.java:266)java.util.concurrent.Executors$RunnableAdapter.call(Executitors.java:511)位于java.util.concurrent.FFutureTask.run(FutureTask.java:266)java.util.concurrent.ThreadPoolExecutiator.runWorker(ThreadPoolExecutiator.java:1142)在java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)在java.lang.Thread.run(Thread.java:745)[error](*:更新)sbt。ResolveException:未解析的依赖项:org.scala-lang#scala库;2.10.3:在中找不到配置org.scala-lang#scala库;2.10.3:"编译"。它是从默认#全局插件;0.0提供
~/.sbt/0.13/plugins/build.sbt
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
resolvers += "mvnrepository" at "http://mvnrepository.com/artifact/"
resolvers += Resolver.typesafeRepo("releases")
resolvers += Resolver.sonatypeRepo("releases")
resolvers += Resolver.sbtPluginRepo("releases")
cat ~/.sbt/0.13/plugins/plugins.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0")
该问题与兼容性问题有关。SBT与JDK8不直接兼容。我通过添加下面的依赖项解决了这个问题。
libraryDependencies += "org.scala-lang.modules" %% "scala-java8-compat" % "0.2.0"
我尝试了"最佳答案",但它没有解决我的问题。我了解到我只是使用了错误的sbt
版本。当我改为安装sbt 0.13.11
时,插件错误得到了解决。