How to install Grails 2.4.4 plugin from zip?

折月煮酒 提交于 2019-12-25 03:32:07

问题


I have a need for the grails-spring-security-ldap plugin in 2.4.4. However, the latest maven-published plugin doesn't work with 2.4.X, but commits have been made to the git repo (https://github.com/grails-plugins/grails-spring-security-ldap) to make it work.

I've downloaded the code and successfully packaged it a zip file. I've also read that you can no longer drop zips in the the project/lib directory and expect it to be found after adding it to BuildConfig.groovy. So, I installed to my local m2 directory with:

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

I then added 'compile ":grails-spring-security-ldap:2.0-SNAPSHOT"' to BuildConfig.groovy. However, it still tries to find it in the grails repo (see below error) and won't look locally. What am I doing wrong?

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:


Since Grails 2.3, it is no longer possible to install plugins directly from the file system.

If you wish to use local plugins then run 'maven-install' in the plugin directory to install the plugin into your local Maven cache.

Then inside your application's grails-app/conf/BuildConfig.groovy file declare the dependency and it will be resolved from your Maven cache.

If you make a change to the plugin simply run 'maven-install' in the directory of the plugin project again and the change will be picked up by the application



来源:https://stackoverflow.com/questions/29169405/how-to-install-grails-2-4-4-plugin-from-zip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!