问题
I am trying to configure a Grails app to use the latest stable SpringSec-CAS plugin and for the life of me cannot find the proper version of both SpringSec and the plugin I should be using.
I am on Grails 2.3.6. What should I include in BuildConfig.groovy
to get the latest stable versions? I have:
plugins {
compile ":spring-security-core:2.0-RC2"
compile ":spring-security-cas:2.0-RC1"
}
When I specify SpringSec 2.0-RC2 and SpringSec-CAS 2.0-RC1 I get the following errors when running grails run-app
:
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: org.springframework.security:spring-security-web:jar:3.2.0.RC1, org.springframework.security:spring-security-cas:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-web:jar:3.2.0.RC1 in mylocalartifactory_artifactory_libs-snapshots-local_ (http://mylocalartifactory/artifactory/libs-snapshots-local/) (Use --stacktrace to see the full trace)
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: org.springframework.security:spring-security-web:jar:3.2.0.RC1, org.springframework.security:spring-security-cas:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-web:jar:3.2.0.RC1 in mylocalartifactory_artifactory_libs-snapshots-local_ (http://mylocalartifactory/artifactory/libs-snapshots-local/) (Use --stacktrace to see the full trace)
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: org.springframework.security:spring-security-web:jar:3.2.0.RC1, org.springframework.security:spring-security-cas:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-web:jar:3.2.0.RC1 in mylocalartifactory_artifactory_libs-snapshots-local_ (http://mylocalartifactory/artifactory/libs-snapshots-local/) (Use --stacktrace to see the full trace)
| Error The following artifacts could not be resolved: org.springframework.security:spring-security-web:jar:3.2.0.RC1, org.springframework.security:spring-security-cas:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-web:jar:3.2.0.RC1 in mylocalartifactory_artifactory_libs-snapshots-local_ (http://mylocalartifactory/artifactory/libs-snapshots-local/)
I take it that I don't have my repositories set up correctly...? How can I modify my BuildConfig.groovy
to pull these deps in from Maven Central?
Running Grails dependency report:
+--- org.grails.plugins:spring-security-core:2.0-RC2
| >>>> org.springframework.security:spring-security-web:3.2.0.RC1
+--- org.grails.plugins:spring-security-cas:2.0-RC1
| \--- org.jasig.cas.client:cas-client-core:3.2.1
| >>>> org.springframework.security:spring-security-cas:3.2.0.RC1
Still not 100% sure what the problem is.
回答1:
Adding mavenRepo "http://repo.spring.io/milestone/" resolved the dependency issue for me.
来源:https://stackoverflow.com/questions/23367266/grails-springsec-depends-on-jars-that-arent-in-maven-central