我输入以下命令来添加Spring security plugin
。
$ grails install-plugin spring-security-core
$ grails s2-quickstart org.example.auth Person Authority
当我输入上述命令时,我得到的是:
| Script 'S2Quickstart' not found, did you mean:
1) Stats
2) DbmListLocks
3) InstallJQuery
4) TestApp
5) DbmClearChecksums
> Please make a selection or enter Q to quit: q
我该如何解决这个问题?
更新
| Configuring classpath
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: org.springframework.security:spring-security-core:jar:3.2.0.RC1, org.springframework.security:spring-security-web:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-core:jar:3.2.0.RC1 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: org.springframework.security:spring-security-core:jar:3.2.0.RC1, org.springframework.security:spring-security-web:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-core:jar:3.2.0.RC1 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: org.springframework.security:spring-security-core:jar:3.2.0.RC1, org.springframework.security:spring-security-web:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-core:jar:3.2.0.RC1 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
| Error The following artifacts could not be resolved: org.springframework.security:spring-security-core:jar:3.2.0.RC1, org.springframework.security:spring-security-web:jar:3.2.0.RC1: Could not find artifact org.springframework.security:spring-security-core:jar:3.2.0.RC1 in grailsCentral (http://repo.grails.org/grails/plugins)
| Run 'grails dependency-report' for further information.
答案 0 :(得分:10)
因为您使用的是2.3.4 不推荐使用install-plugin
这是你做的事情
第1步:打开BuilConfig.groovy
第2步:在存储库中添加此行
mavenRepo "http://repo.spring.io/milestone/"
repositories {
mavenRepo "http://repo.spring.io/milestone/"
}
第3步:在插件片段中添加此行
compile ":spring-security-core:2.0-RC2"
plugins {
compile ':spring-security-core:2.0-RC2'
}
第4步:执行命令
grails compile
第5步:执行命令
s2-quickstart
你完成了
答案 1 :(得分:3)
运行后
grails install-plugin spring-security-core
您需要先编译应用程序。通过运行
grails compile
然后,你运行
grails s2-quickstart org.example.auth Person Authority
答案 2 :(得分:1)
您没有说Grails的版本,但假设为2.0+,请不要使用install-plugin
(已弃用),而是按照plugin install instructions和
将以下内容添加到您的grails-app / conf / BuildConfig
plugins { compile ':spring-security-core:2.0-RC2' }
然后运行grails compile
,s2-quickstart
任务将可用
答案 3 :(得分:1)
试试这个:
将其添加到插件
plugins {
compile ':spring-security-core:2.0-RC2'
}
然后将其添加到存储库
repositories {
mavenRepo 'http://repo.spring.io/milestone'
}
然后执行clean并编译,然后运行
grails s2-quickstart org.example.auth Person Authority