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

时间:2015-09-22 22:25:21

标签: java sbt apache-commons-logging

我在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$1.apply(IvyActions.scala:126)
    at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:125)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:115)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:115)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:103)
    at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:48)
    at sbt.IvySbt$$anon$3.call(Ivy.scala:57)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.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$1$1.apply(Defaults.scala:1223)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1221)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$74.apply(Defaults.scala:1244)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$74.apply(Defaults.scala:1242)
    at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1246)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1241)
    at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
    at sbt.Classpaths$.cachedUpdate(Defaults.scala:1249)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1214)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1192)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.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"

1 个答案:

答案 0 :(得分:1)

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

尝试将JBoss repo添加到build.sbt中的解析器列表中(这是99.0不存在的地方) - 以下对我有用 - 编译成功。

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

如果你的lib中需要另一个版本的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 - 不存在 - 这很好。