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

时间:2017-08-21 05:47:39

标签: scala sbt

我在解决依赖关系时遇到了一些问题。

我已经查看了很多关于此事的其他帖子,但是那些要么已过时(仅与更新后的0.13相关),要么是为解决问题而添加了额外的解析器,或导致问题的scala版本,这与我的案件无关,将在下面解释:

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社区存储库的Sbt 1.0.0-2

运行OS:Antergos内核4.12.8-2-ARCH

scala版本2.12.3

我确保我添加的每个库依赖项都出现在网站maven存储库的解析器列表中

但是,我收到的错误消息是

[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

我记得在我的sbt收到更新之后以及几天前在我的Ubuntu 17.04中添加额外的库依赖项时,这种情况发生了。有什么我忽略的导致了这个错误吗?

在更新之前,它使用built.sbt。

运行完全正常

1 个答案:

答案 0 :(得分:0)

通过删除offline := true

解决了该问题

这最有可能仅适用于Linuxsbt 1.0及以上的offline := true,因为在MacOS中使用def func(X, A, Ta, B, Tb, m, n): alpha,T = X return (((A * exp(-Ta/T)) + (B * exp(-Tb/T))) * ((alpha / 100) ** m)) * ((1 - (alpha / 100)) ** n init_vals = [1000000, 10000, 10000000, 10000, 0.5, 0.8] print(curve_fit(func, (alpha,T), dadt, p0=init_vals)) ,它仍然能够毫无问题地获得依赖关系。