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

属性。

我的 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”成功完成。

4

3 回答 3

8

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

project/plugins.sbt中:

resolvers += Resolver.url("Typesafe Ivy Snapshots", url("http://repo.typesafe.com/typesafe/ivy-snapshots/"))(Resolver.ivyStylePatterns)
于 2012-09-06T04:52:14.213 回答
6

发现问题。我需要通过在文件解析器之后添加“Resolver.ivyStylePatterns”来将“My Repository”声明为 Ivy 存储库,如下所示:

Resolver.file("My Repository", file( "repository/local/") )(Resolver.ivyStylePatterns)
于 2012-05-17T13:03:52.990 回答
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/"
于 2014-09-11T02:46:16.853 回答