我在開發應用程序中通過GGTS 3.4.0使用grails 2.3.3,現在我想開始使用Spring安全核心插件。帶有grails的Spring Security Core插件
我試圖把它列入,未果,在我的應用程序的構建,加入到BuildConfig.groovy的插件部分文件的行:
compile "org.grails.plugins:spring-security-core:2.0.0"
但是這樣一個運行時得到該插件這種依賴性錯誤-app:
糾正錯誤獲取相關性:無法解析的依賴
看着另注我想:
compile "org.grails.plugins:spring-security-core:2.0-RC2"
在buildconfig文件的插件部分
和:
mavenRepo 'http://repo.spring.io/milestone'
與相同的依賴錯誤問題的文件庫部分
。
我得到了我使用的grails/GGTS版本插件的錯誤版本嗎?
這是當前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"
}
}
發送到控制檯顯示所有在線位置的構建去嘗試並找到彈簧安全核心軟件的日誌 - 這裏是一個所有這些位置的列表:
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
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://grails.org/plugin:http://grails.org/plugin/grails-spring-security-core/tags/RELEASE_3.1.1/spring-security-core-3.1.1.pom
-Mike
沒有仍然得到依賴性錯誤。 – mikek
在插件部分,我嘗試了各種版本的spring-security-core插件,但沒有取得任何成功。也許我需要將另一行添加到buildconfig文件的「存儲庫」部分中?或者,我可以明確地下載插件 - 如果不確定要做什麼?我可以看到文件grails-spring-security-core-master.zip可以從github網站下載,但我不知道如何使用它?此外,這個新版本的安全核心可以與Grails 2.3.3一起工作嗎? – mikek
你是否遵循了文檔中提到的配置步驟:https://grails-plugins.github.io/grails-spring-security-core/v3/index.html#s2-quickstart? –