我是Play Framework的新手,无法添加托管依赖项。
播放版本 2.2.2 ,sbt 0.13.0 。
在下面的示例中,我尝试“管理”/下载(?)Apache Derby库,但我也尝试过其他几个和许多不同的解析器。该库最终成为一个未解决的依赖。
我已经阅读了http://www.playframework.com/documentation/2.2.2/SBTDependencies中管理依赖项的内容。
我尝试过一堆不同的库并确保它们可以访问并且解析器是正确的。问题不在于防火墙/代理,因为我通过直接连接到互联网进行了测试。
build.sbt 的设置如下(我尝试了所有可以想象的变体):
name := "kursguiden"
version := "1.0-SNAPSHOT"
resolvers += "Maven Central" at "http://repo1.maven.org/maven2/"
resolvers += "mvnrepository" at "http://mvnrepository.com/artifact/"
libraryDependencies ++= Seq(
"org.apache.derby" % "derby" % "10.4.1.3",
javaJdbc,
javaEbean,
cache
)
play.Project.playJavaSettings
和 plugins.sbt :
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2")
当我运行play update
或play run
时,我在播放控制台中收到此错误消息:
[kursguiden] $ update
[info] Updating {file:/C:/play/kursguiden/}kursguiden...
[info] Resolving org.scala-lang#scala-library;2.10.3 ...
[info] Resolving org.apache.derby#derby;10.4.1.3 ...
[error] Server access Error: Connection timed out: connect url=http://repo1.mave
n.org/maven2/org/apache/derby/derby/10.4.1.3/derby-10.4.1.3.pom
[error] Server access Error: Connection timed out: connect url=http://repo1.mave
n.org/maven2/org/apache/derby/derby/10.4.1.3/derby-10.4.1.3.pom
[error] Server access Error: Connection timed out: connect url=http://mvnreposit
ory.com/artifact/org/apache/derby/derby/10.4.1.3/derby-10.4.1.3.pom
.
.
.
[info] Resolving commons-io#commons-io;2.4 ...
[info] Resolving org.scala-lang#scala-compiler;2.10.3 ...
[info] Resolving org.scala-lang#jline;2.10.3 ...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
warn] ::::::::::::::::::::::::::::::::::::::::::::::
warn] :: UNRESOLVED DEPENDENCIES ::
warn] ::::::::::::::::::::::::::::::::::::::::::::::
warn] :: org.apache.derby#derby;10.4.1.3: not found
warn] ::::::::::::::::::::::::::::::::::::::::::::::
trace] Stack trace suppressed: run last *:update for the full output.
error] (*:update) sbt.ResolveException: unresolved dependency: org.apache.derby
derby;10.4.1.3: not found
error] Total time: 422 s, completed 2014-mar-20 23:11:27
这只是一个经过尝试的例子。花了最后8个小时解决这个问题:)
您认为可能是什么问题?我可以通过浏览器访问所有文件,所以我的线索是某处必须有一些奇怪的设置。
答案 0 :(得分:0)
您的构建文件对我有用。看来Server access Error: Connection timed out: connect
是您的连接或服务器本身的临时网络问题。再试一次。
您可能还想从 build.sbt 中删除以下resolvers
,因为我认为他们不需要(至少是最后一个):
resolvers += "Maven Central" at "http://repo1.maven.org/maven2/"
resolvers += "mvnrepository" at "http://mvnrepository.com/artifact/"