1
votes

I had some problem with sbt regarding to resolving the dependencies.

I had look through a lot of other post regarding to this matter, but however those are either outdated (which only relevant to 0.13 after update), or extra resolver added to solve the problem, or scala version that cause the problem, which is irrelevant to my case which will be explain below:

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 version: Sbt 1.0.0-2 from arch community repository

Running OS: Antergos kernel 4.12.8-2-ARCH

scala version 2.12.3

I had make sure that every library dependencies that I add are appear in resolvers list of repository from the website maven repository

However, the error message that I get is

[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

I remember this happen short after I receive an update in my sbt and when I add an extra library dependencies few days back in my Ubuntu 17.04. Are there anything that I overlooked that caused this error?

Before the update, it run absolutely fine with the built.sbt.

1
Do you use any SBT plugins? I know they are bound to SBT version. There could be an slight chance that some plugin could cause this.Vasiliy Ivashin
No, I don't use any plugin at allTony Ng Wei Shyang

1 Answers

0
votes

The solution is solved by removing offline := true

This is most likely to be only applicable to Linux with sbt 1.0 and above, because with offline := true in MacOS, it is still be able to get the dependencies without problem.