scala - silhouette - DEPENDENCIAS SIN RESOLVER instalando Deadbolt en Play Framework 2.2.1
documentation play framework (3)
No estoy seguro de por qué no está viendo plugins.sbt
, pero de acuerdo con la documentación 2.2.1, debería estar allí. http://www.playframework.com/documentation/2.2.1/Build
Para agregar las dependencias a plugins.sbt
, incluya las siguientes líneas en el archivo:
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")
Nota: Dependiendo de las necesidades de su proyecto, es posible que solo necesite uno de los dos complementos.
Me gustaría probar Deadbolt. ¿Cuáles son los pasos para instalarlo en el nuevo Play Framework 2.2.1? Lo que encontré aquí son resolvedores y dependencias . ¿Pero dónde tengo que poner los resolvedores? No quiero usar Build.scala
(en Play 2.2 hay build.sbt
)
Y aquí hay una línea sobre el plugin . ¿Donde va? En mi proyecto no hay plugins.sbt
y no sé si Play 2.2 prefiere ponerlo en otro lugar.
EDITAR :
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"
)
Jugar a los errores de la consola:
[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
Intente agregar esto a su archivo build.sbt. Resolvió problemas que estaba teniendo con las dependencias securesocial y postgresql:
resolvers += Resolver.url("sbt-plugin-releases", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
No agregue nada a plugins.sbt
, siguiendo la documentación oficial: https://github.com/schaloner/deadbolt-2/tree/master
Agregue a su build.sbt
(sin ,
y 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)
Y
libraryDependencies ++= Seq(
...
"be.objectify" %% "deadbolt-java" % "2.2-RC4",
"be.objectify" %% "deadbolt-scala" % "2.2-RC2"
)
En el momento de escribir im usando play 2.2.1 y mine build.sbt es:
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
Después de ejecutar play reload
y play eclipse
desde la consola:
...
[info] [SUCCESSFUL ]
[info] Done updating.
...
EDITAR: No te olvides de play reload
y play eclipse
después de agregar nuevas dependencias a build.sbt
EDIT2: Supongo que después de Deadbolt quieres usar el sistema play-authenticate, porque Deadbolt no proporciona autenticación. Puede encontrar el sistema play-authenticate en: https://github.com/joscha/play-authenticate .
Con DeadBolt y el sistema de autentificación de reproducción mine build.sbt es:
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