SBT 无法解决 PlayFramework 2.4.2 的所有依赖项

标签 sbt dependency-management ivy playframework-2.4

我尝试根据 instructions 设置一个新的 Play Framework 2.4.2 项目但我从看似常见的库中收到了 Unresolved 依赖项错误。

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: oauth.signpost#signpost-core;1.2.1.2: configuration not found in oauth.signpost#signpost-core;1.2.1.2: 'master(compile)'. Missing configuration: 'compile'. It was required from com.typesafe.play#play-ws_2.11;2.4.2 compile
[warn]  :: commons-logging#commons-logging;1.1.1: configuration not found in commons-logging#commons-logging;1.1.1: 'master(compile)'. Missing configuration: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.0.1 compile
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]          oauth.signpost:signpost-core:1.2.1.2
[warn]            +- oauth.signpost:signpost-commonshttp4:1.2.1.2
[warn]            +- com.typesafe.play:play-ws_2.11:2.4.2 (D:\work\my-app\build.sbt#L9-15)
[warn]            +- my-app:my-app_2.11:1.0-SNAPSHOT
[warn]          commons-logging:commons-logging:1.1.1
[warn]            +- org.apache.httpcomponents:httpclient:4.0.1
[warn]            +- oauth.signpost:signpost-commonshttp4:1.2.1.2
[warn]            +- com.typesafe.play:play-ws_2.11:2.4.2 (D:\work\my-app\build.sbt#L9-15)
[warn]            +- my-app:my-app_2.11:1.0-SNAPSHOT

我的plugins.sbt看起来像

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.2")

// web plugins

addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.6")

addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")

我的build.sbt看起来像

name := """my-app"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.6"

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  specs2 % Test
)

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator

build.properties

#Activator-generated Properties
#Thu Oct 22 21:22:58 CEST 2015
template.uuid=fce2d244-c545-409f-806e-7a0c3681b306
sbt.version=0.13.8

对我来说,一切似乎都是正确的,但由于某些原因,com.typesafe.play:play-ws_2.11:2.4.2 所需的这些依赖项无法解析。

最佳答案

解决方案是打开我的 %USERPROFILE%\.ivy2\cache 并从其中删除 commons-loggingoauth.signpost 文件夹。

感谢这个回答 https://stackoverflow.com/a/28456949/410568

关于SBT 无法解决 PlayFramework 2.4.2 的所有依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33289594/

相关文章:

sbt - Play Framework 无法识别在 Build.scala 中传递的 Java 选项(JVM args)

java - 查看dependencyManagement的依赖树

gradle - 什么时候两个工件被视为相等?

java - Ivy:具有不同依赖文件的多个检索任务

dependencies - Ivy:将所有依赖项安装到共享存储库

scala - sbt 跨项目共享依赖关系

scala - 如何在Windows上从Maven和SBT获得彩色输出?

scala - SBT 交叉构建 - 为不同的 Scala 版本选择不同的库版本

java - 具有大量依赖项的项目中依赖项管理的最佳实践

Ivy :<ivy:settings> vs. <ivy:configure>