如何从zip安装Grails 2.4.4插件?

时间:2015-03-20 14:50:47

标签: grails grails-plugin

我需要2.4.4中的grails-spring-security-ldap插件。但是,最新的maven发布的插件不能与2.4.X一起使用,但是已经对git repo(https://github.com/grails-plugins/grails-spring-security-ldap)进行了提交以使其正常工作。

我已下载代码并成功将其打包为zip文件。我还读到你不能再在项目/ lib目录中删除拉链,并希望在将它添加到BuildConfig.groovy之后找到它。所以,我安装到我的本地m2目录:

grails maven-install ./grails-spring-security-ldap-2.0-SNAPSHOT.zip

然后我添加'编译":grails-spring-security-ldap:2.0-SNAPSHOT"'到BuildConfig.groovy。但是,它仍然试图在grails repo中找到它(见下面的错误)并且不会在本地查找。我做错了什么?

Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:grails-spring-security-ldap:zip:2.0-SNAPSHOT in grailsCentral (https://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:grails-spring-security-ldap:zip:2.0-SNAPSHOT in grailsCentral (https://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:grails-spring-security-ldap:zip:2.0-SNAPSHOT in grailsCentral (https://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
Error |
Could not find artifact org.grails.plugins:grails-spring-security-ldap:zip:2.0-SNAPSHOT in grailsCentral (https://repo.grails.org/grails/plugins)
|Run 'grails dependency-report' for further information.

1 个答案:

答案 0 :(得分:2)

自Grails 2.3以来,再也无法直接安装插件了 文件系统。

如果您希望使用本地插件,请在插件目录中运行“maven-install”,将插件安装到本地Maven缓存中。

然后在你的应用程序的grails-app / conf / BuildConfig.groovy文件中声明依赖项,它将从你的Maven缓存中解析。

如果你对插件进行了更改,只需再次在插件项目的目录中运行'maven-install',然后应用程序就会选择更改