部署基于Play 2.1-SNAPSHOT的应用到Heroku

6

我有一个基于Play 2.1-SNAPSHOT的应用程序,在本地运行良好,但是当我尝试部署到Heroku时,出现以下错误:

   [warn]   ::::::::::::::::::::::::::::::::::::::::::::::
   [warn]   ::          UNRESOLVED DEPENDENCIES         ::
   [warn]   ::::::::::::::::::::::::::::::::::::::::::::::
   [warn]   :: play#sbt-plugin;2.1-SNAPSHOT: not found
   [warn]   ::::::::::::::::::::::::::::::::::::::::::::::
   [warn]
   [warn]   Note: Some unresolved dependencies have extra attributes.  Check  that these dependencies exist with the requested

attributes.

我的plugins.sbt文件指向一个包含2.1-SNAPSHOT依赖项的本地存储库:

resolvers ++= Seq( 
  "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
  Resolver.file("My Repository", file( "repository/local") )
)

// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1-SNAPSHOT")

目录“repository/local”已经被提交到我的GIT存储库中。看起来在Heroku上的SBT正在查找本地存储库,因为在“未解决的依赖项”错误之前,我看到以下警告:
   [warn] ==== Typesafe repository: tried
   [warn]   http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.1_0.11.2/2.1-SNAPSHOT/sbt-plugin-2.1-SNAPSHOT.pom
   [warn] ==== My Repository: tried
   [warn] ==== heroku-sbt-typesafe: tried
   [warn] ==== heroku-central: tried
在本地运行"play stage"命令成功完成。

我认为另一种方法是添加CloudBees CI快照存储库,而不是使用本地文件存储库。 - James Ward
3个回答

8

如果您不想使用本地文件存储库,则另一种选择是将Typesafe的ivy-snapshots存储库添加为插件解析器。

project/plugins.sbt中:

resolvers += Resolver.url("Typesafe Ivy Snapshots", url("http://repo.typesafe.com/typesafe/ivy-snapshots/"))(Resolver.ivyStylePatterns)

6

找到了问题所在。我需要通过在文件解析器后添加“Resolver.ivyStylePatterns”来将“我的仓库”声明为Ivy存储库,如下所示:

Resolver.file("My Repository", file( "repository/local/") )(Resolver.ivyStylePatterns)

0

http://repo.typesafe.com/typesafe/ivy-snapshots/似乎不再活跃,以下配置适用于我:

在你的plugins.sbt中:

//play sbt-plugin snapshot

resolvers += Resolver.url("Typesafe Simple Snapshots", url("https://repo.typesafe.com/typesafe/simple/snapshots/"))(Resolver.ivyStylePatterns)

//play snapshot 

resolvers +=  "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

// The Play plugin 

addSbtPlugin("com.typesafe.play" %% "sbt-plugin" % "2.4-SNAPSHOT")

在你的 build.sbt 文件中

//play snapshot 

resolvers +=  "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接