如何将 commons-logging 添加到我的 build.sbt 文件?

How do I add commons-logging to my build.sbt file?

我要在 build.sbt 文件中添加什么来解决这个问题?

[warn]  module not found: commons-logging#commons-logging;99.0-does-not-exist
[warn] ==== local: tried
[warn]   /Users/jay/.ivy2/local/commons-logging/commons-logging/99.0-does-not-exist/ivys/ivy.xml
[warn] ==== activator-launcher-local: tried
[warn]   file:/Users/jay/local/activator-1.3.2-minimal/repository/commons-logging/commons-logging/99.0-does-not-exist/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/commons-logging/commons-logging/99.0-does-not-exist/commons-logging-99.0-does-not-exist.pom
[warn] ==== typesafe-releases: tried
[warn]   https://repo.typesafe.com/typesafe/releases/commons-logging/commons-logging/99.0-does-not-exist/commons-logging-99.0-does-not-exist.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/commons-logging/commons-logging/99.0-does-not-exist/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   https://repo.typesafe.com/typesafe/releases/commons-logging/commons-logging/99.0-does-not-exist/commons-logging-99.0-does-not-exist.pom
[info] Resolving jline#jline;2.11 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: commons-logging#commons-logging;99.0-does-not-exist: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: commons-logging#commons-logging;99.0-does-not-exist: not found
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)
    at sbt.IvyActions$$anonfun$update.apply(IvyActions.scala:126)
    at sbt.IvyActions$$anonfun$update.apply(IvyActions.scala:125)
    at sbt.IvySbt$Module$$anonfun$withModule.apply(Ivy.scala:115)
    at sbt.IvySbt$Module$$anonfun$withModule.apply(Ivy.scala:115)
    at sbt.IvySbt$$anonfun$withIvy.apply(Ivy.scala:103)
    at sbt.IvySbt.sbt$IvySbt$$action(Ivy.scala:48)
    at sbt.IvySbt$$anon.call(Ivy.scala:57)
    at xsbt.boot.Locks$GlobalLock.withChannel(Locks.scala:93)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries(Locks.scala:78)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock.apply(Locks.scala:97)
    at xsbt.boot.Using$.withResource(Using.scala:10)
    at xsbt.boot.Using$.apply(Using.scala:9)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.IvySbt.withDefaultLogger(Ivy.scala:57)
    at sbt.IvySbt.withIvy(Ivy.scala:98)
    at sbt.IvySbt.withIvy(Ivy.scala:94)
    at sbt.IvySbt$Module.withModule(Ivy.scala:115)
    at sbt.IvyActions$.update(IvyActions.scala:125)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work.apply(Defaults.scala:1223)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work.apply(Defaults.scala:1221)
    at sbt.Classpaths$$anonfun$doWork$$anonfun.apply(Defaults.scala:1244)
    at sbt.Classpaths$$anonfun$doWork$$anonfun.apply(Defaults.scala:1242)
    at sbt.Tracked$$anonfun$lastOutput.apply(Tracked.scala:35)
    at sbt.Classpaths$$anonfun$doWork.apply(Defaults.scala:1246)
    at sbt.Classpaths$$anonfun$doWork.apply(Defaults.scala:1241)
    at sbt.Tracked$$anonfun$inputChanged.apply(Tracked.scala:45)
    at sbt.Classpaths$.cachedUpdate(Defaults.scala:1249)
    at sbt.Classpaths$$anonfun$updateTask.apply(Defaults.scala:1214)
    at sbt.Classpaths$$anonfun$updateTask.apply(Defaults.scala:1192)
    at scala.Function1$$anonfun$compose.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$$anonfun$apply.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$$anonfun$apply.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$$anonfun.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: unresolved dependency: commons-logging#commons-logging;99.0-does-not-exist: not found

我已经尝试了以下所有方法,但都不起作用:

"commons-logging" % "commons-logging" % "99.0-does-not-exist",
"commons-logging" % "commons-logging" % "1.2",
"commons-logging" % "commons-logging" % "1.1.1",

添加行时出现此错误:

"com.google.code.geocoder-java" % "geocoder-java" % "0.16"

这是我的 build.sbt:

name := """cxo-enricher"""

lazy val root = (project in file(".")).enablePlugins(PlayJava, GitVersioning)

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(
  javaWs,
  "com.amazonaws" % "aws-java-sdk-dynamodb" % "1.10.12",
  "com.amazonaws" % "aws-java-sdk-s3" % "1.10.12",
  "com.amazonaws" % "aws-java-sdk-sqs" % "1.10.12",
  "org.json" % "json" % "20141113",
  "de.malkusch.whois-server-list" % "public-suffix-list" % "2.0.1",
  "com.timgroup" % "java-statsd-client" % "3.0.1",
  "com.google.code.geocoder-java" % "geocoder-java" % "0.16"
)

Commons.settings

dockerRepository := Some("XXXX")

version in Docker := "latest"

commons-logging#commons-logging;99.0-does-not-exist 是一个什么都不做的虚拟实现。

尝试将 JBoss 存储库添加到您的 build.sbt 中的解析器列表(这是托管 99.0-does-not-exist 的地方)- 以下对我有用 - 编译成功。

resolvers ++= Seq(
        "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases",
        "JBoss" at "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/"
)

如果您的库中需要另一个版本的 commons-logging,那么您仍然可以声明 1.2,例如,在您的依赖项列表中。

libraryDependencies ++= Seq(
  "commons-logging" % "commons-logging" % "1.2",
  "com.google.code.geocoder-java" % "geocoder-java" % "0.16",
  jdbc,
  cache,
  ws,
  specs2 % Test
)

当您构建项目时,SBT 会警告您它已驱逐 99.0-does-not-exist - 这很好。