UNRESOLVED DEPENDENCIES installing Deadbolt on Play Framework 2.2.1

可紊 提交于 2019-11-29 10:03:40

Dont add anything to plugins.sbt, following official documentation: https://github.com/schaloner/deadbolt-2/tree/master

Add to your build.sbt (without , and with one blank line)

resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.com/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.com/snapshots/"))(Resolver.ivyStylePatterns)

And

libraryDependencies ++= Seq(
  ...
  "be.objectify" %% "deadbolt-java" % "2.2-RC4",
  "be.objectify" %% "deadbolt-scala" % "2.2-RC2"
)

In time of writing im using play 2.2.1 and mine build.sbt is:

name := "crud-test"

version := "1.0-SNAPSHOT"

resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.com/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.com/snapshots/"))(Resolver.ivyStylePatterns)

libraryDependencies ++= Seq(
  javaJdbc,
  javaJpa,
  "org.postgresql" % "postgresql" % "9.2-1003-jdbc4",
  "org.hibernate" % "hibernate-entitymanager" % "3.6.9.Final",
  "org.webjars" % "webjars-play_2.10" % "2.2.1",
  "org.webjars" % "bootstrap" % "3.1.0",
  "be.objectify" %% "deadbolt-java" % "2.2-RC4",
  "be.objectify" %% "deadbolt-scala" % "2.2-RC2"
)

play.Project.playJavaSettings

After running play reload and play eclipse from console:

...
[info] [SUCCESSFUL ]
[info] Done updating.
...

EDIT: Don't forget to do play reload and play eclipse after adding new dependencies to build.sbt

EDIT2: I guess that after Deadbolt you want to use play-authenticate system, because Deadbolt doesn’t provide authentication. You can find play-authenticate system on: https://github.com/joscha/play-authenticate.

With DeadBolt and play-authenticate system mine build.sbt is:

name := "crud-test"

version := "1.0-SNAPSHOT"

resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.com/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.com/snapshots/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("play-easymail (release)", url("http://joscha.github.com/play-easymail/repo/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("play-easymail (snapshot)", url("http://joscha.github.com/play-easymail/repo/snapshots/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("play-authenticate (release)", url("http://joscha.github.com/play-authenticate/repo/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("play-authenticate (snapshot)", url("http://joscha.github.com/play-authenticate/repo/snapshots/"))(Resolver.ivyStylePatterns)

libraryDependencies ++= Seq(
  javaJdbc,
  javaJpa,
  "org.postgresql" % "postgresql" % "9.2-1003-jdbc4",
  "org.hibernate" % "hibernate-entitymanager" % "3.6.9.Final",
  "org.webjars" % "webjars-play_2.10" % "2.2.1" exclude("org.scala-lang", "scala-library"),
  "org.webjars" % "bootstrap" % "3.1.0",
  "be.objectify" %% "deadbolt-java" % "2.2-RC4",
  "be.objectify" %% "deadbolt-scala" % "2.2-RC2",
  "com.feth" %% "play-authenticate" % "0.5.0-SNAPSHOT"
)

play.Project.playJavaSettings

Try adding this to your build.sbt file. It resolved issues I was having with securesocial and postgresql dependencies:

resolvers += Resolver.url("sbt-plugin-releases", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

I'm not sure why you're not seeing plugins.sbt, but according to the 2.2.1 documentation, it should be there. http://www.playframework.com/documentation/2.2.1/Build

To add the dependencies to plugins.sbt, include the following lines in the file:

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)

addSbtPlugin("be.objectify" %% "deadbolt-java" % "2.2-RC2")
addSbtPlugin("be.objectify" %% "deadbolt-scala" % "2.2-RC2")

Note: Depending on your project's needs, you may only need one of the two plugins.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!