【问题标题】:How to add unmanaged dependency in play 2 project running on heroku如何在 heroku 上运行的 play 2 项目中添加非托管依赖项
【发布时间】: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


【解决方案1】:

所以,我找到了答案。我推错了分支。

我盲从教程,写着:

git push heroku 大师

将我的 master 分支推送到 heroku。

我应该写的

git push heroku dev:master

这将我的开发分支推送到了 heroku。这解决了这个问题。

【讨论】:

    猜你喜欢
    • 2016-12-12
    • 2011-12-28
    • 1970-01-01
    • 2012-12-30
    • 2017-09-18
    • 1970-01-01
    • 1970-01-01
    • 2015-02-18
    • 2013-03-21
    相关资源
    最近更新 更多