3

我有一个无法解决的传递依赖,我为此而烦恼。

具体的依赖是org.apache.maven.wagon#wagon-provider-api;1.0-beta-2!wagon-provider-api.jar虽然我不确定哪个直接依赖包括它。

该文件在默认的 Maven 存储库中是有效的。然而,出于某种原因,SBT 只是拒绝在那里检查它,尽管它很高兴在那里寻找其他依赖项:

[warn]  [NOT FOUND  ] org.apache.maven.wagon#wagon-provider-api;1.0-beta-2!wagon-provider-api.jar (52ms)
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.apache.maven.wagon#wagon-provider-api;1.0-beta-2!wagon-provider-api.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] (*:update) sbt.ResolveException: download failed: org.apache.maven.wagon#wagon-provider-api;1.0-beta-2!wagon-provider-api.jar
[error] Total time: 3 s, completed Mar 23, 2013 7:22:05 PM

我已删除.ivy2,.m2.sbt从我的主目录中删除。我跑了sbt update。我跑play cleanplay clean-all一遍又一遍。从SBTresolvers提示运行显示 Maven 存储库在列表中。

我已经尝试下载 jar 并将其添加到我的 Ivy 缓存、我的 Ivy 存储库、我的 Play!存储库。

还有什么可以尝试的?

我的 Build.scala:

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "conspire"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    javaCore,
    javaJdbc,
    "mysql" % "mysql-connector-java" % "5.1.18",
    "org.apache.cayenne.plugins" % "maven-cayenne-plugin" % "3.0.2",
    "org.objectstyle.ashwood" % "ashwood" % "2.0",
    "commons-collections" % "commons-collections" % "3.1",
    "commons-lang" % "commons-lang" % "2.6",
    "commons-logging" % "commons-logging" % "1.1"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    externalResolvers += "Local Maven Repository" at "file:///"+Path.userHome+"/.m2/repository",
    resolvers ++= Seq(DefaultMavenRepository,
                      "Objectstyle repository" at " http://objectstyle.org/maven2/")
  )

}
4

3 回答 3

1

尝试

resolvers := // which overrides current resolvers

代替

resolvers ++= // which appends to current resolvers

不过不要问我解释,因为我不知道它为什么会起作用。刚刚与 JUnit 有类似的问题,这个链接建议这样做,这有助于......

于 2013-03-24T12:48:38.837 回答
0

代替 :

resolvers :=  

(它的缺点是不允许多个解析器。)我发现

resolvers += 

工作正常,并且不会出现来自 OP 的错误。

于 2014-05-13T21:06:19.280 回答
0

我有一个类似的问题。但是 SBT 甚至会在 maven repo 中搜索它所说的链接不起作用,实际上是有效的。

我通过在默认播放 stuf 之前移动我自己的依赖项来解决它:

val appDependencies = Seq(
    // Add your project dependencies here,
    javaCore,
    javaJdbc,
    "mysql" % "mysql-connector-java" % "5.1.32"
  )

val appDependencies = Seq(
    "mysql" % "mysql-connector-java" % "5.1.32",
    javaCore,
    javaJdbc    
  )

希望这对其他人有帮助。干杯

于 2014-09-19T17:22:26.027 回答