grails - 无法在Grails 3中导入grails.plugin.springsecurity.annotation?

标签 grails spring-security grails-3.0

我一直在关注Burt Beckwith关于Spring Security for Grails 3的教程。我按照教程中的说明安装了build.gradle插件,并运行了s2-quickstart,它似乎运行良好。该项目编译无投诉。

但是当我尝试导入语句

import grails.plugin.springsecurity.annotation.Secured

导入无法识别且无法生成,出现错误
Error:(2, 1) Groovyc: unable to resolve class grails.plugin.springsecurity.annotation.Secured

缺少了什么?

build.gradle的依赖项部分:
dependencies {
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.grails:grails-core"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:scaffolding"
    compile "org.grails.plugins:hibernate4"
    compile "org.hibernate:hibernate-ehcache"
    compile 'org.grails.plugins:spring-security-core:3.1.1'  //*** 
    console "org.grails:grails-console"
    profile "org.grails.profiles:web"
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.8.2"
    runtime "com.h2database:h2"
    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"
    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"

最佳答案

通过单击“ View \工具\ Gradle”窗口中的“刷新”图标,我能够解决IntelliJ中的此问题。

关于grails - 无法在Grails 3中导入grails.plugin.springsecurity.annotation?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39562498/

相关文章:

Grails:Grails3:doWithWebDescriptor?

grails - Grails 4:@GrailsCompileStatic注释不起作用

grails - MemSQL 的 GORM 引用表

java - 如何配置 Spring Security 以使用 OAuth 而不是基本授权?

spring - 基于 XML 的 Spring Security 配置中的 use-expressions 属性等同于基于代码的配置

Grails 3 CSRF 保护

spring - grails 3 spring安全启动启动程序登录页面自定义

grails - 在id字段上进行Grails搜索会引发错误

string - 在 Grails 中连接多个字符串

java - 未调用 Spring 安全自定义 LogoutHandler