2
  1. As stated here if I put the resolvers in plugins.sbt Play doesn't see them. But it works if I move them in build.sbt. Is there a reason?

  2. Another problem: if there isn't the file play.plugins I get this error: "**Exception:** The Deadbolt Java plugin was not registered, or is disabled. Please check your conf/play.plugins file." But it isn't written in any installation guide that play.plugins is needed to install Deadbolt (maybe it was needed for older version). source 1 source 2

In conclusion, I think there's a big confusion about Deadbolt installation. Someone could clarify?

Community
  • 1
  • 1
Fred K
  • 13,249
  • 14
  • 78
  • 103

1 Answers1

3
  1. plugins.sbt is for plugins to sbt, the build tool, so for example you would put a release plugin, or maybe a count lines of code-plugin there, build.sbt is for your actual project so stuff you want to use inside your project goes there

  2. for play to load plugins that you have made available on the classpath (either by putting them in the lib/ directory or by adding a managed dependency in you build.sbt) you must always add them to conf/play.plugins. That you need to do that is noted in the deadbolt-2 docs, altough not on the first page of the docs: https://github.com/schaloner/deadbolt-2-guide/blob/master/04-deadbolt-java-hooks.markdown

johanandren
  • 11,249
  • 1
  • 25
  • 30
  • Hi johan. Point 1: then putting Deadbolt resolvers in build.sbt is correct and is more correct than into plugins.sbt. Right? Point 2: ok, then why other plugins I'm using (like mysql-connector-java and apache commons-email) work perfectly without putting them in play.plugins? thanks – Fred K Nov 13 '13 at 14:17
  • 1. yes, correct! 2. mysql-connector-java and apache-commons-email are just libraries, not play plugins - they know nothing of the play application lifecycle while deadbolt wants to plug into play and get created with the application and shut down with the application. – johanandren Nov 13 '13 at 14:41
  • Perfect, very clear johan. Tried and all works great now. One last thing: when I navigate to a restricted page with an unauthorized user it doesn't access but in the Play console I get this error: `"[error] application - Access to [/restricted-page] requires a subject, but no subject is present. [warn] application - Deadbolt: Access failure on [/restricted-page]"`. Is it correct that it shows that error? – Fred K Nov 13 '13 at 16:25
  • I'm afraid I don't know, haven't used deadbolt myself, nothing in the deadbolt docs about what is supposed to happen? – johanandren Nov 13 '13 at 21:54