2016-09-18 3 views
1

私はBurt BeckwithのSpring Security for Grails 3のチュートリアルに従ってきました。私はチュートリアルで述べたようにプラグインbuild.gradleをインストールし、うまくいくように見えるs2-quickstartを実行しました。プロジェクトは苦情なしでコンパイルされます。私はGrails 3のgrails.plugin.springsecurity.annotationをインポートできませんか?

import grails.plugin.springsecurity.annotation.Secured 

import文をしようとすると

ただし、インポートが認識されないし、何が不足しているか、エラー

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

私はGradleのウィンドウ\ビュー\ツールで「リフレッシュ」アイコンをクリックしてのIntelliJでこの問題を解決することができました。

関連する問題