我尝试将我的应用程序从Grails 2.4.4升级到Grails 3.0.2,我对spring注释有问题。
我有控制器,像这样:
import grails.plugins.springsecurity.annotation.Secured
class MyController {
@Secured(['ROLE_ADMINS_GROUP'])
def index() {
// some code
}
}
在depencencies
的{{1}}块中我有这个:
build.gradle
当我尝试编译我的应用程序时,收到错误消息。
dependencies {
provided 'org.springframework.boot:spring-boot-starter-logging'
provided "org.springframework.boot:spring-boot-starter-actuator"
provided "org.springframework.boot:spring-boot-autoconfigure"
provided "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.springframework.boot:spring-boot-starter-security"
provided "org.grails:grails-web-boot"
provided "org.grails:grails-dependencies"
provided 'javax.servlet:javax.servlet-api:3.1.0'
testCompile "org.grails:grails-plugin-testing"
console "org.grails:grails-console"
compile "org.grails.plugins:wslite:0.7.2.0"
}
答案 0 :(得分:1)
Spring Security Core Plugin已经更新,现在与Grails 3.0兼容,请参阅文档:What's New in Version 3.0
只需将以下依赖项添加到dependencies
文件的build.gradle
块:
compile "org.grails.plugins:spring-security-core:3.0.0.M1"