【发布时间】:2015-03-22 13:53:28
【问题描述】:
我正在尝试向在 Heroku 上运行的 play 2 项目添加依赖项。
我已阅读此内容:https://www.playframework.com/documentation/2.0/SBTDependencies,并且我尝试过添加托管和非托管依赖项。
当我尝试添加非托管依赖项时,出现以下错误:
sbt.ResolveException: unresolved dependency: com.cloudbees.thirdparty#zendesk-java-client;0.2.5-SNAPSHOT: not found
这里是警告信息:
remote: [warn] module not found: com.cloudbees.thirdparty#zendesk-java-client;0.2.5-SNAPSHOT
remote: [warn] ==== local: tried
remote: [warn] /tmp/scala_buildpack_build_dir/.sbt_home/.ivy2/local/com.cloudbees.thirdparty/zendesk-java-client/0.2.5-SNAPSHOT/ivys/ivy.xml
remote: [warn] ==== public: tried
remote: [warn] http://repo1.maven.org/maven2/com/cloudbees/thirdparty/zendesk-java-client/0.2.5-SNAPSHOT/zendesk-java-client-0.2.5-SNAPSHOT.pom
remote: [warn] ==== Typesafe Releases Repository: tried
remote: [warn] https://repo.typesafe.com/typesafe/releases/com/cloudbees/thirdparty/zendesk-java-client/0.2.5-SNAPSHOT/zendesk-java-client-0.2.5-SNAPSHOT.pom
remote: [warn] ==== Local Maven Repository: tried
remote: [warn] file:///Users/lars/.m2/repository/com/cloudbees/thirdparty/zendesk-java-client/0.2.5-SNAPSHOT/zendesk-java-client-0.2.5-SNAPSHOT.pom
因此,它看起来就像在本地计算机上的 maven 存储库中查找一样。我假设这个文件夹在 Heroku 上不存在。
我已将 .jar 文件添加到项目中名为 lib/ 的文件夹中。
这是我的 build.sbt 文件:
name := """name here"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
"org.postgresql" % "postgresql" % "9.4-1201-jdbc41",
javaJdbc,
javaEbean,
cache,
javaWs
)
有人对尝试什么有什么建议吗?会不会是heroku-project没有清理干净,一些旧设置挂了?
谢谢。
【问题讨论】:
-
默认情况下,heroku 上的 SBT 在构建项目之前不会运行
clean任务。您可以通过向 heroku 添加设置来强制执行此操作:heroku config:set SBT_CLEAN=true
标签: maven heroku playframework-2.3