如何从 zip 安装 Grails 2.4.4 插件?
How to install Grails 2.4.4 plugin from zip?
我需要 2.4.4 中的 grails-spring-security-ldap 插件。然而,最新的 maven 发布的插件不适用于 2.4.X,但已提交到 git 存储库 (https://github.com/grails-plugins/grails-spring-security-ldap) 以使其工作。
我已下载代码并成功将其打包为 zip 文件。我还读到您不能再将 zips 放到 project/lib 目录中,并希望在将它添加到 BuildConfig.groovy 后找到它。所以,我安装到我的本地 m2 目录:
grails maven-install ./grails-spring-security-ldap-2.0-SNAPSHOT.zip
然后我将 'compile ":grails-spring-security-ldap:2.0-SNAPSHOT"' 添加到 BuildConfig.groovy。但是,它仍然会尝试在 grails 存储库中找到它(请参阅下面的错误)并且不会在本地查找。我做错了什么?
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.
从 Grails 2.3 开始,不再可以直接从
文件系统。
如果您希望使用本地插件,请在插件目录中 运行 'maven-install' 将插件安装到本地 Maven 缓存中。
然后在您的应用程序的 grails-app/conf/BuildConfig.groovy 文件中声明依赖关系,它将从您的 Maven 缓存中解析。
如果您再次在插件项目的目录中 运行 'maven-install' 对插件进行更改,应用程序将获取更改
我需要 2.4.4 中的 grails-spring-security-ldap 插件。然而,最新的 maven 发布的插件不适用于 2.4.X,但已提交到 git 存储库 (https://github.com/grails-plugins/grails-spring-security-ldap) 以使其工作。
我已下载代码并成功将其打包为 zip 文件。我还读到您不能再将 zips 放到 project/lib 目录中,并希望在将它添加到 BuildConfig.groovy 后找到它。所以,我安装到我的本地 m2 目录:
grails maven-install ./grails-spring-security-ldap-2.0-SNAPSHOT.zip
然后我将 'compile ":grails-spring-security-ldap:2.0-SNAPSHOT"' 添加到 BuildConfig.groovy。但是,它仍然会尝试在 grails 存储库中找到它(请参阅下面的错误)并且不会在本地查找。我做错了什么?
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.
从 Grails 2.3 开始,不再可以直接从 文件系统。
如果您希望使用本地插件,请在插件目录中 运行 'maven-install' 将插件安装到本地 Maven 缓存中。
然后在您的应用程序的 grails-app/conf/BuildConfig.groovy 文件中声明依赖关系,它将从您的 Maven 缓存中解析。
如果您再次在插件项目的目录中 运行 'maven-install' 对插件进行更改,应用程序将获取更改