8

在 play 2.1 和之前的版本中,我必须添加解析器Build.scala

val main = play.Project(appName, appVersion, appDependencies).settings(
    resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.io/releases/"))(Resolver.ivyStylePatterns),
    resolvers += Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.io/snapshots/"))(Resolver.ivyStylePatterns)
  )

在 2.2 中,我必须build.sbt像这样:

...
resolvers += "Objectify Play Snapshot Repository" at "http://schaloner.github.com/snapshots/"
...

但这似乎不起作用,找不到依赖项。

有任何想法吗?

4

3 回答 3

12

您将其添加为 maven 存储库,但在旧配置中您说它是 ivy 存储库,我认为它应该类似于:

resolvers += Resolver.url("Repo-name", url("http://example.com/"))(Resolver.ivyStylePatterns)

查看有关解析器的 sbt 0.13(播放 2.2 使用)文档以获取更多信息: http ://www.scala-sbt.org/release/docs/Detailed-Topics/Resolvers.html

于 2013-09-27T12:04:04.967 回答
4

更新:

此解决方案不起作用,我在缓存中有依赖项。

我是这样解决的:

项目/plugins.sbt

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers ++= Seq(
        Resolver.url("Objectify Play Repository", url("http://schaloner.github.io/releases/"))(Resolver.ivyStylePatterns),
        "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
)

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

然后我可以在build.sbt添加依赖:

name := "test"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  "be.objectify" %% "deadbolt-java" % "2.2-RC1"
)     

play.Project.playJavaSettings
于 2013-09-27T16:04:05.680 回答
0

为了将来参考,只需将其单独添加到末尾的新行中build.sbt

检查http://www.playframework.com/documentation/2.2.x/Build

name := "my-app"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
...
)     

play.Project.playJavaSettings

resolvers += "itext repository" at "http://jasperreports.sourceforge.net/maven2/"
于 2014-03-31T04:42:05.507 回答