【发布时间】:2013-11-24 13:28:52
【问题描述】:
我想试试 Deadbolt。在新的 Play Framework 2.2.1 上安装它的步骤是什么?
我发现的是 resolvers 和 dependencies here。但是我必须把解析器放在哪里?我不想使用Build.scala(在 Play 2.2 中有build.sbt)
而here 是关于插件的一行。它去哪儿了?在我的项目中没有plugins.sbt,不知道Play 2.2是否更喜欢把它放在其他地方。
编辑:
plugin.sbt
resolvers ++= Seq(
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
Resolver.url("Objectify Play Repository", url("http://schaloner.github.io/releases/"))(Resolver.ivyStylePatterns),
Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.io/snapshots/"))(Resolver.ivyStylePatterns)
)
build.sbt
libraryDependencies ++= Seq(
javaJdbc,
javaEbean,
cache,
"mysql" % "mysql-connector-java" % "5.1.27",
"org.apache.commons" % "commons-email" % "1.3.1",
"be.objectify" %% "deadbolt-java" % "2.2-RC2"
)
播放控制台错误:
[info] Resolving org.hibernate.javax.persistence#hibernate-jpa-2.0-api;1.0.1.Fin[info] Resolving be.objectify#deadbolt-java_2.10;2.2-RC2 ...
[warn] module not found: be.objectify#deadbolt-java_2.10;2.2-RC2
[warn] ==== local: tried
[warn] /Users/johndoe/Applications/play-2.2.1/repository/local/be.objectify/deadbolt-java_2.10/2.2-RC2/ivys/ivy.xml
[warn] ==== Maven2 Local: tried
[warn] file:/Users/johndoe/.m2/repository/be/objectify/deadbolt-java_2.10/2.2-RC2/deadbolt-java_2.10-2.2-RC2.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/be/objectify/deadbolt-java_2.10/2.2-RC2/deadbolt-java_2.10-2.2-RC2.pom
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/be/objectify/deadbolt-java_2.10/2.2-RC2/deadbolt-java_2.10-2.2-RC2.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: be.objectify#deadbolt-java_2.10;2.2-RC2: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: be.objectify#deadbolt-java_2.10;2.2-RC2: not found
[error] Total time: 3 s, completed 12-n
【问题讨论】:
-
为什么要避免 Build.scala?另外,你确定没有 plugins.sbt 吗? 2.2 文档说它应该在那里。
-
无需在
Build.scala上回答我的问题。查看文档后,我看到它已被替换。对于没有plugins.sbt的问题,可以尝试将文件添加到project/目录下。
标签: scala playframework sbt playframework-2.2 deadbolt