2016-09-18 5 views
1

Я следил за учебником Burt Beckwith по Spring Security для Grails 3. Я установил плагин build.gradle, как он сказал в учебнике, и запустил s2-quickstart, который, кажется, работает нормально. Проект компилируется без жалобы.Невозможно импортировать grails.plugin.springsecurity.nnation в Grails 3?

Однако, когда я пытаюсь оператор импорта

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" 
+1

Попробуйте очистить и скомпилировать проект. – quindimildev

+0

Также он помогает заставить Gradle обновлять зависимости в вашей среде IDE или через «gradle -refresh-dependencies». – Yuri

+0

Спасибо вам обоим. – user1023110

ответ

5

Я был в состоянии решить эту проблему в IntelliJ, нажав на значок «Обновить» в окне \ Tools \ окна Gradle.