简体   繁体   English

带有 grails 的 Spring Security 核心插件

[英]Spring Security Core Plugin with grails

I am using grails 2.3.3 via a GGTS 3.4.0 in a development application and I now want to start to use the Spring security core plugin.我在开发应用程序中通过 GGTS 3.4.0 使用 grails 2.3.3,现在我想开始使用 Spring 安全核心插件。

I have tried to include it, unsuccessfully, in my application build by adding into plugin part of the BuildConfig.groovy file the line:我试图通过将以下行添加到 BuildConfig.groovy 文件的插件部分来将它包含在我的应用程序构建中,但未成功:

compile "org.grails.plugins:spring-security-core:2.0.0"

But get this dependency error on that plugin when doing a run-app:但是在执行 run-app 时会在该插件上出现此依赖项错误:

Resolve error obtaining dependencies: Failed to resolve dependencies解决获取依赖时出错:无法解析依赖

looking at another note I tried:看着我试过的另一个笔记:

compile "org.grails.plugins:spring-security-core:2.0-RC2"

in the plugin part of the buildconfig file and:在 buildconfig 文件的插件部分和:

        mavenRepo 'http://repo.spring.io/milestone'

in the repositories part of the the file with the same dependency error issue.在具有相同依赖项错误问题的文件的存储库部分。

Have I got the wrong version of the plugin for the version of grails/GGTS that I'm using?我使用的 grails/GGTS 版本的插件版本是否错误?

Here is the current BuildConfig.groovy :这是当前的 BuildConfig.groovy :

grails.servlet.version = "2.5" // Change depending on target container     compliance (2.5 or 3.0)
grails.project.work.dir = 'target'
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
    // specify dependency exclusions here; for example, uncomment this to    disable ehcache:
    // excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info',  'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve

repositories {
    inherits true // Whether to inherit repository definitions from plugins

    grailsPlugins()
    grailsHome()
    grailsCentral()

    mavenLocal()

    mavenCentral()

    // uncomment these (or add new ones) to enable remote dependency  resolution from public Maven repositories
    //mavenRepo "http://snapshots.repository.codehaus.org"
    //mavenRepo "http://repository.codehaus.org"
    //mavenRepo "http://download.java.net/maven/2/"
    //mavenRepo "http://repository.jboss.com/maven2/"

    mavenRepo 'http://repo.spring.io/milestone'

    grailsRepo "http://grails.org/plugins"

}
dependencies {
    // specify dependencies here under either 'build', 'compile', 'runtime',  'test' or 'provided' scopes eg.

    // runtime 'mysql:mysql-connector-java:5.1.20'
    runtime 'mysql:mysql-connector-java:5.1.27'

    compile "org.grails.plugins:spring-security-core:2.0.0"


}

plugins {
    //runtime ":hibernate:$grailsVersion"

    //compile 'utils:utils:1.4-SNAPSHOT'

    compile ":hibernate:3.6.10.4"

    //runtime ":jquery:1.7.2"
    runtime ":jquery:1.10.2"

    //runtime ':pvpi:0.1-SNAPSHOT'
    //runtime (':pvpi:0.1'){
        //changing = true
    //}

    //runtime ":resources:1.1.6"
    runtime ":resources:1.2.1"

    // Uncomment these (or add new ones) to enable additional resources capabilities
    //runtime ":zipped-resources:1.0"
    //runtime ":cached-resources:1.0"
    //runtime ":yui-minify-resources:0.1.4"

    build ":tomcat:7.0.47"
    //build ":tomcat:$grailsVersion"

    //runtime ":database-migration:1.1"
    runtime ":database-migration:1.3.8"

    //compile ':cache:1.0.0'
    compile ':cache:1.1.1'

    compile ":scaffolding:2.0.0"

    compile ":spring-security-core:2.0.0"

    }
}

The logs sent to the console display all the online locations that the build goes to try and find the the spring-security-core software - here is a list of all these locations:发送到控制台的日志显示构建尝试查找 spring-security-core 软件的所有在线位置 - 以下是所有这些位置的列表:

grailsCentral: http://grails.org/plugins/grails-spring-security-core/tags/RELEASE_3.1.1/spring-security-core-3.1.1.pom grailsCentral: http ://grails.org/plugins/grails-spring-security-core/tags/RELEASE_3.1.1/spring-security-core-3.1.1.pom

mavenCentral: http://repo1.maven.org/maven2/org/grails/plugins/spring-security-core/3.1.1/spring-security-core-3.1.1.pom mavenCentral: http: //repo1.maven.org/maven2/org/grails/plugins/spring-security-core/3.1.1/spring-security-core-3.1.1.pom

http://mvnrepository.com/artifact/ : http://mvnrepository.com/artifact/org/grails/plugins/spring-security-core/3.1.1/spring-security-core-3.1.1.pom http://mvnrepository.com/artifact/ : http://mvnrepository.com/artifact/org/grails/plugins/spring-security-core/3.1.1/spring-security-core-3.1.1.pom

http://repo.spring.io/milestone/ : http://repo.spring.io/milestone/org/grails/plugins/spring-security-core/3.1.1/spring-security-core-3.1.1.pom http://repo.spring.io/milestone/http://repo.spring.io/milestone/org/grails/plugins/spring-security-core/3.1.1/spring-security-core-3.1.1 .pom

http://grails.org/plugin : http://grails.org/plugin/grails-spring-security-core/tags/RELEASE_3.1.1/spring-security-core-3.1.1.pom http://grails.org/plugin : http://grails.org/plugin/grails-spring-security-core/tags/RELEASE_3.1.1/spring-security-core-3.1.1.pom

-mike -麦克风

What if you try with如果你尝试

compile ":spring-security-core:2.0-RC5"

in your BuildConfig.groovy plugins section在你的 BuildConfig.groovy 插件部分

You can access the follow link above to take the last version of this pluggin.您可以访问上面的以下链接以获取此插件的最新版本。

https://repo.grails.org/grails/core/org/grails/plugins/spring-security-core/ https://repo.grails.org/grails/core/org/grails/plugins/spring-security-core/

Right now, the correct command is:现在,正确的命令是:

compile "org.grails.plugins:spring-security-core:3.1.1"

Works for me.为我工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM