当前位置: 首页 > 知识库问答 >
问题:

SBT 1.0模块未找到未解析的依赖项

翁宏茂
2023-03-14

关于解决依赖关系,我与sbt有一些问题。

built.sbt

version := "1.0"

scalaVersion := "2.12.3"

offline := true

fork := true

scalacOptions ++= Seq("-unchecked", "-deprecation")

unmanagedJars in Compile += Attributed.blank(file(System.getenv("JAVA_HOME") + "/jre/lib/ext/jfxrt.jar"))

addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)

libraryDependencies ++= Seq(
  "commons-io" % "commons-io" % "2.5",
  "org.scala-lang.modules" %% "scala-async" % "0.9.7", //async library
  "org.scalaz" %% "scalaz-concurrent" % "7.2.14" 
)

resolvers ++= Seq(
      "Sonatype OSS Snapshots" at
        "https://oss.sonatype.org/content/repositories/snapshots",
      "Sonatype OSS Releases" at
        "https://oss.sonatype.org/content/repositories/releases",
      "Typesafe Repository" at
        "http://repo.typesafe.com/typesafe/releases/"
    )

Sbt版本:来自arch community repository的Sbt 1.0.0-2

运行操作系统:Antergos内核4.12.8-2-arch

[warn]  module not found: commons-io#commons-io;2.5
[warn] ==== local: tried
[warn] ==== public: tried
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded: tried
[warn] ==== Sonatype OSS Snapshots: tried
[warn] ==== Sonatype OSS Releases: tried
[warn] ==== Typesafe Repository: tried
[warn]  module not found: org.scala-lang.modules#scala-async_2.12;0.9.7
[warn] ==== local: tried
[warn] ==== public: tried
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded: tried
[warn] ==== Sonatype OSS Snapshots: tried
[warn] ==== Sonatype OSS Releases: tried
[warn] ==== Typesafe Repository: tried
[warn]  module not found: org.scalaz#scalaz-concurrent_2.12;7.2.14
[warn] ==== local: tried
[warn] ==== public: tried
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded: tried
[warn] ==== Sonatype OSS Snapshots: tried
[warn] ==== Sonatype OSS Releases: tried
[warn] ==== Typesafe Repository: tried
[warn]  module not found: org.scalamacros#paradise_2.12.3;2.1.0
[warn] ==== local: tried
[warn] ==== public: tried
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded: tried
[warn] ==== Sonatype OSS Snapshots: tried
[warn] ==== Sonatype OSS Releases: tried
[warn] ==== Typesafe Repository: tried
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: commons-io#commons-io;2.5: not found
[warn]  :: org.scala-lang.modules#scala-async_2.12;0.9.7: not found
[warn]  :: org.scalaz#scalaz-concurrent_2.12;7.2.14: not found
[warn]  :: org.scalamacros#paradise_2.12.3;2.1.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      commons-io:commons-io:2.5 (/home/gaara/sbt/ConcurrencyScala/built.sbt#L17-22)
[warn]        +- myapp:myapp_2.12:1.0
[warn]      org.scala-lang.modules:scala-async_2.12:0.9.7 (/home/gaara/sbt/ConcurrencyScala/built.sbt#L17-22)
[warn]        +- myapp:myapp_2.12:1.0
[warn]      org.scalaz:scalaz-concurrent_2.12:7.2.14 (/home/gaara/sbt/ConcurrencyScala/built.sbt#L17-22)
[warn]        +- myapp:myapp_2.12:1.0
[warn]      org.scalamacros:paradise_2.12.3:2.1.0 (/home/gaara/sbt/ConcurrencyScala/built.sbt#L15-16)
[warn]        +- myapp:myapp_2.12:1.0
[error] sbt.librarymanagement.ResolveException: unresolved dependency: commons-io#commons-io;2.5: not found
[error] unresolved dependency: org.scala-lang.modules#scala-async_2.12;0.9.7: not found
[error] unresolved dependency: org.scalaz#scalaz-concurrent_2.12;7.2.14: not found
[error] unresolved dependency: org.scalamacros#paradise_2.12.3;2.1.0: not found
[error]     at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:331)
[error]     at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:205)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:229)
[error]     at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:190)
[error]     at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error]     at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[error]     at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
[error]     at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
[error]     at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
[error]     at xsbt.boot.Using$.withResource(Using.scala:10)
[error]     at xsbt.boot.Using$.apply(Using.scala:9)
[error]     at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
[error]     at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
[error]     at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error]     at xsbt.boot.Locks$.apply(Locks.scala:28)
[error]     at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error]     at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:185)
[error]     at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:182)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:228)
[error]     at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:190)
[error]     at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error]     at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error]     at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:38)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:91)
[error]     at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:64)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:104)
[error]     at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:104)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:87)
[error]     at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:141)
[error]     at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:118)
[error]     at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2313)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:64)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
[error]     at sbt.Execute.work(Execute.scala:266)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] (*:update) sbt.librarymanagement.ResolveException: unresolved dependency: commons-io#commons-io;2.5: not found
[error] unresolved dependency: org.scala-lang.modules#scala-async_2.12;0.9.7: not found
[error] unresolved dependency: org.scalaz#scalaz-concurrent_2.12;7.2.14: not found
[error] unresolved dependency: org.scalamacros#paradise_2.12.3;2.1.0: not found
[error] Total time: 1 s, completed Aug 21, 2017 1:41:06 PM

共有1个答案

周墨一
2023-03-14

通过删除脱机:=true来解决该解决方案

这很可能只适用于LinuxSBT1.0及更高版本,因为在MacOS中使用offline:=true,仍然可以毫无问题地获取依赖项。

 类似资料:
  • 这是build.sbt文件: 更新:查看解析器 [play21-osm]$show resolvers[信息]列表(Typesafe Releases repository:http://repo.Typesafe.com/Typesafe/Releases/,Typesafe relepository:http://Typesafe.artifactoryonline.com/Typesafe,

  • 我刚刚在Coursera上开始Scala专门化的函数编程。正在进行设置并查看第一个视频。当我修改Intellij中的sbt时,我得到“Module not found:org.scallatest#scalatest2.11;2.2.6” 我的sbt如下所示: 版本:=“1.0” scalaVersion:=“2.11.8”libraryDependencies+=“org.scallatest”

  • 我做错了什么? 我已经将Intellij设置为使用Scala2.11.8,但输出可能意味着使用了不同的版本(?)。 我试过以前一个类似问题的想法,但没有帮助: 更新:我将SBT版本更改为0.13.18后的输出

  • 当我试图导入依赖项时,我收到以下错误: 请帮帮我,我哪里错了? 事先谢谢你

  • 尝试部署 Web 应用程序时,由于日志记录错误(如下所示),它将失败: Java . lang . nosuchmethoderror:org . SLF 4j . SPI . locationawarelogger . log(Lorg/SLF 4j/Marker;ljava/lang/String;il Java/lang/String;ljava/lang/Throwable;) 我已经谷歌

  • 问题内容: 我不敢相信我在问一个明显的问题,但在控制台日志中仍然出现错误。 控制台表示无法在目录中找到该模块,但是我至少检查了10次错别字。无论如何,这是组件代码。 我想在根中渲染 Header 这是组件 我至少检查了10次该模块是否在此位置(文件夹“ header”包含“ header.js”)。 然而,React仍然抛出此错误: 编译失败 NPM测试 说的是同样的话。 问题答案: 我们通常使用