Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 如何将缺少的快照依赖项添加到Heroku?_Scala_Github_Heroku_Playframework_Sbt - Fatal编程技术网

Scala 如何将缺少的快照依赖项添加到Heroku?

Scala 如何将缺少的快照依赖项添加到Heroku?,scala,github,heroku,playframework,sbt,Scala,Github,Heroku,Playframework,Sbt,我有一个Scala Play 2.7.x应用程序,部署到Heroku。但是,由于缺少依赖项“com.github.totoshi”%%“play joda routes binder”%%“1.3.1-SNAPSHOT”,构建失败,这是正确的,因为我在本地构建了这个依赖项。如何使Heroku可以使用此缺少的依赖项 我需要的依赖项是这个https://github.com/tototoshi/play-joda-routes-binder但它有一个bug,我在这里修复了它https://githu

我有一个Scala Play 2.7.x应用程序,部署到Heroku。但是,由于缺少依赖项
“com.github.totoshi”%%“play joda routes binder”%%“1.3.1-SNAPSHOT”
,构建失败,这是正确的,因为我在本地构建了这个依赖项。如何使Heroku可以使用此缺少的依赖项


我需要的依赖项是这个
https://github.com/tototoshi/play-joda-routes-binder
但它有一个bug,我在这里修复了它
https://github.com/tototoshi/play-joda-routes-binder/pull/6
。然而,这个项目的作者似乎已经有好几个月没有工作了。我可以在本地构建我的PR,但如何将其添加到Heroku以使我的项目正常工作?

您可以将已编译的jar放入项目的子文件夹中,例如:
/lib
。Sbt将自动在此目录中查找JAR。如果要将其配置为其他内容,可以在非托管数据库中定义密钥:

unmanagedBase := baseDirectory.value / "custom_lib"
这里有更多关于sbt库管理的文档:

playframework也记录了这一点,但基本上是一样的:

另一种解决方案是不使用连接到Github的自动部署,而是使用SBT Heroku CLI,然后在本地构建/部署,只需将二进制工件上传到Heroku,如下所示:

sbt stage deployHeroku
heroku open --app myapp
在将以下两个条目添加到
项目/plugins.sbt
文件后(截至今天的最新版本):


我建议您将您的版本部署到maven central/jfrog/sonatype或类似的版本
addSbtPlugin("com.heroku" % "sbt-heroku" % "2.1.2")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.4.1")