Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails Spring Core Security Plugin - Unable to Resolve Classes

I'm using Grails 2.2.2 and I've already installed spring-security-core-2.0-RC2, by adding the below lines in my BuildConfig.groovy file:

Under the plugins:    
compile ':spring-security-core:2.0-RC2'

Under Repositories:
mavenRepo 'http://repo.spring.io/milestone'

The plugin was installed successfully and I've created the security Domains and Controllers using s2-quickstart script.

Now, I've updated one of my controllers with the below code:

import grails.plugins.springsecurity.Secured
@Secured(['ROLE_ADMIN']) 

However when I try to run the application I get the below error:

| Error Compilation error: startup failed: C:\workspace\SW Development\Production\MyGrailsApp\safami\grails-app\controllers\safami\InfoPageAdminController.groovy: 4: unable to resolve class grails.plugins.springsecurity.Secured @ line 4, column 1. import grails.plugins.springsecurity.Secured

I'm new to Grails and I need your detailed solution.

like image 375
user2972217 Avatar asked Nov 09 '13 15:11

user2972217


1 Answers

The annotation was moved to a different package - change

import grails.plugins.springsecurity.Secured

to

import grails.plugin.springsecurity.annotation.Secured
like image 59
Burt Beckwith Avatar answered Oct 25 '22 08:10

Burt Beckwith