无法解析class grails.plugins.springsecurity.Secured-Grails 2.3.11

时间:2018-09-28 18:40:47

标签: grails

我在旧的grails中有一个项目,我正在尝试将其升级到grails 2.3.11的新版本,但是这给多租户插件的导入带来了错误,这是一个示例。错误:

D:\~.groovy: 5: unable to resolve class grails.plugins.springsecurity.Secured
 @ line 5, column 1.
   import grails.plugins.springsecurity.Secured
   ^

D:\~.groovy: 3: unable to resolve class grails.plugins.springsecurity.Secured
 @ line 3, column 1.
   import grails.plugins.springsecurity.Secured

这是我的buildConfig:

grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes 'ehcache'
    }
    log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    repositories {
        grailsPlugins()
        grailsHome()
        grailsCentral()

        // uncomment the below to enable remote dependency resolution
        // from public Maven repositories
        mavenLocal()
        mavenCentral()
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    }
    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

        // runtime 'mysql:mysql-connector-java:5.1.13'
        // https://mvnrepository.com/artifact/org.gagravarr/vorbis-java-core
        compile group: 'org.gagravarr', name: 'vorbis-java-core', version: '0.8'

    }
    plugins {
        //build ":tomcat:7.0.52.1"
        build ":tomcat:7.0.70"
        runtime ":hibernate:3.6.10.9"

        compile ':scaffolding:2.0.3'

        runtime ":jquery:1.8.3"
        compile ':cache:1.1.1'

        runtime ':resources:1.2.8'

        compile ":cache-headers:1.1.5"
        runtime ":cached-resources:1.0"
        runtime ":zipped-resources:1.0"
        runtime ":yui-minify-resources:0.1.5"

        // framework dependencies
        compile ":mail:1.0.1"
        compile ":fields:1.4"
        compile ":runtime-logging:0.4"
        compile ":burning-image:0.5.1"
        compile ":twitter-bootstrap:2.3.2"
        compile ":spring-security-core:2.0-RC4"
        compile ":spring-security-rest:1.4.0.RC5"/*, {
            excludes: 'spring-security-core'
        }*/

        // events to implement app hooks
        compile ":platform-core:1.0.RC6"

        // Para fazer upload de imagens
        compile ":attachmentable:0.3.0"

        // calendários para campos do tipo Date
        compile ":calendar:1.2.1"

        // exportar dados para Excel
        compile ":excel-export:0.1.9", {
            excludes: 'xerces'
        }

        // Jasper Reports
        compile ":jasper:1.11.0"

        // Export CSV
        compile ":csv:0.3.1"

        // Tests
        test ":cucumber:0.6.2"

        // Profiling
        compile ":profiler:0.5"

        //webservice SOAP
        compile ":cxf:1.1.4"
        compile ":cxf-client:2.0.3"

        //cron job
        compile ":quartz:1.0.2"

        compile ":ws-client:1.0"
        compile ":multi-tenant-single-db:0.8.3"

        //compile ":falcone-util:1.0"
    }
}

有人知道如何解决此错误吗?还是我必须更改buildconfig才能解决,也许是更新的插件?

1 个答案:

答案 0 :(得分:1)

如果您检查文档中的grails-spring-security-core,可能会发现提到的有问题的类:grails.plugins.springsecurity.Secured是 现在用作grails.plugin.springsecurity.annotation.Secured

因此,如果要在项目的任何地方使用它,则应更新import语句。