加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – 在Play Framework 2.2.1上安装Deadbolt的无法解决的依

发布时间:2020-12-16 09:24:07 所属栏目:安全 来源:网络整理
导读:我想试试Deadbolt.在新的Play Framework 2.2.1上安装它的步骤是什么? 我找到的是解析器和依赖项 here.但是我必须把解析器放在哪里?我不想使用Build.scala(在Play 2.2中有build.sbt) 而here是一个关于插件的线.去哪儿了?在我的项目中没有plugins.sbt,也不
我想试试Deadbolt.在新的Play Framework 2.2.1上安装它的步骤是什么?
我找到的是解析器和依赖项 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

解决方法

不要向plugins.sbt添加任何内容,请遵循官方文档:
https://github.com/schaloner/deadbolt-2/tree/master

添加到您的build.sbt(没有,并带有一个空行)

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(
  ...
  "be.objectify" %% "deadbolt-java" % "2.2-RC4","be.objectify" %% "deadbolt-scala" % "2.2-RC2"
)

在使用play 2.2.1编写im时,我的build.sbt是:

name := "crud-test"

version := "1.0-SNAPSHOT"

resolvers += Resolver.url("Objectify Play 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

运行play reload并从控制台播放eclipse后:

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

编辑:
在添加新的依赖项到build.sbt之后,不要忘记播放重载并播放eclipse

EDIT2:
我想在Deadbolt之后你想使用play-authenticate系统,因为Deadbolt不提供身份验证.您可以在https://github.com/joscha/play-authenticate找到播放验证系统.

使用DeadBolt和play-authenticate系统我的build.sbt是:

name := "crud-test"

version := "1.0-SNAPSHOT"

resolvers += Resolver.url("Objectify Play 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,"org.webjars" % "webjars-play_2.10" % "2.2.1" exclude("org.scala-lang","scala-library"),"be.objectify" %% "deadbolt-scala" % "2.2-RC2","com.feth" %% "play-authenticate" % "0.5.0-SNAPSHOT"
)

play.Project.playJavaSettings

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读