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

时间:2015-10-22 19:56:51

标签: sbt dependency-management ivy playframework-2.4

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

[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所需的这些依赖关系无法解决。

1 个答案:

答案 0 :(得分:5)

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

感谢您的回答https://stackoverflow.com/a/28456949/410568