我正在尝试在play框架( 2.2.4 - java)应用程序中包含用于创建jersey客户端的依赖项。我正在使用JDK 1.7 来运行该应用程序。
当我运行代码(使用play run
)或在我的本地系统(windows)上创建构建(使用play dist
)时,应用程序正常工作。但是,当我尝试在服务器(ubuntu)上创建构建时,构建任务失败并出现以下错误。
[warn] module not found: org.glassfish.hk2#hk2-locator;2.26-b09
[warn] ==== local: tried
[warn] /opt/play-2.2.4/repository/local/org.glassfish.hk2/hk2-locator/2.26-b09/ivys/ivy.xml
[warn] ==== Maven2 Local: tried
[warn] file:/root/.m2/repository/org/glassfish/hk2/hk2-locator/2.26-b09/hk2-locator-2.26-b09.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/glassfish/hk2/hk2-locator/2.26-b09/hk2-locator-2.26-b09.pom
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/glassfish/hk2/hk2-locator/2.26-b09/hk2-locator-2.26-b09.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.glassfish.hk2#hk2-locator;2.26-b09: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] (*:update) sbt.ResolveException: unresolved dependency: org.glassfish.hk2#hk2-locator;2.26-b09: not found
我在Build.scala文件中包含了以下依赖项:
"javax.ws.rs" % "javax.ws.rs-api" % "2.1",
"org.glassfish.jersey.inject" % "jersey-hk2" % "2.26-b09",
"org.glassfish.hk2.external" % "javax.inject" % "2.5.0-b42",
"org.glassfish.jersey.core" % "jersey-client" % "2.26-b09",
"org.glassfish.jersey.core" % "jersey-common" % "2.26-b09",
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.26"
除此之外,我还在Build.scala文件中添加了以下属性
sys.props += "packaging.type" -> "jar"
我看到构建任务试图包含hk2-locator-2.26-b09依赖关系,它不存在。我不确定我可能做错了什么,以及为什么这个设置适用于一个系统而不是另一个系统。
感谢任何帮助。