1
votes

I'm using Grails 3.0.1 with IntelliJ Idea and I'm trying to use Spring Security plugin on my project.

I know that old spring-seurity-core plugin is not compatible with Grails 3.0 version. Thus I've tried to follow this tutorial: http://spiesdavid.blogspot.fi/2015/03/grails-3-app-with-security-part-1.html

I've added the compile line in build.gradle file in dependencies. I've also added the logger line in logback.groovy file.

Problems start after that. There is no such file as SecurityConfiguration.groovy and there is no org.springframework.security package so I can't import them and it gives an error. So I can't create the file either.

2

2 Answers

0
votes

So I am assuming that your question is: «How do I get this to work?»

  • spring security plugin 3.0.0 (for grails 3.x) was released just a few days ago. Documentation is quite good. Start here: https://grails-plugins.github.io/grails-spring-security-core/
  • There are some problems with Intellij. I tried to add spring security to a slightly older grails project (started with intellij 15.0.1 and grails 3.0.9). Adding the dependencies was successful and rebuilding it made the plugin available, also in the grails console. But when I launched a debug instance of the application directly from the IDE, it would not show spring security among the loaded/installed plugins. I made a pristine project with IntelliJ 15.02, grails 3.0.10 and just copied my code over to the new project. Now it works.
0
votes

Note there are some issue with IntelliJ not major. do the following it will work:

  1. on your build.gradle add compile 'org.grails.plugins:spring-security-core:3.0.0.M2'
  2. run command compile
  3. run comand s2-quickstart yourAppName User Role
  4. now you should see "application.groovy" file under conf folder
  5. as usual use @Secured annotation in your controller