手动安装插件?

发布于 2024-08-30 09:52:44 字数 40 浏览 2 评论 0原文

是否可以在grails中手动安装和卸载插件? 如果可以,该怎么办?

is it possible to install and uninstall plugins manually in grails??
if yes, how can it be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

眼眸印温柔 2024-09-06 09:52:44

如果命令由于某种原因失败,您可以通过以下方式删除它们:

  1. 从 application.properties 中删除插件条目
  2. 从 ~/.grails/grails version/projects/ 中删除插件文件夹项目名称/插件

If the commands are failing for some reason, you can remove them by:

  1. delete the entry for the plugin from application.properties
  2. delete the plugin folder from ~/.grails/grails version/projects/project name/plugins
ゃ人海孤独症 2024-09-06 09:52:44

(Grails 2.2.4) 添加一个存在于 grails-project-dir\lib\the-grails-plugin-0.1.zip 目录中的插件。编辑您的 grails-project-dir\grails-app\BuildConfig.groovy 以包含以下内容

plugins {
  // ....
  compile "lib:the-grails-plugin:0.1"
}

这将使用名为 lib\the-grails-plugin 的文件夹更新您的 ivy 缓存

例如:[用户主目录]\.grails\ivy-cache\lib\the-grails-plugin

(Grails 2.2.4) To add a plugin that exists for example in your grails-project-dir\lib\the-grails-plugin-0.1.zip directory. Edit your grails-project-dir\grails-app\BuildConfig.groovy to include the following

plugins {
  // ....
  compile "lib:the-grails-plugin:0.1"
}

This will update your ivy-cache with folder called lib\the-grails-plugin

e.g: [user-home]\.grails\ivy-cache\lib\the-grails-plugin

酷炫老祖宗 2024-09-06 09:52:44

对于 Grails 2.x,这就是

grails install-plugin <plugin>

grails uninstall-plugin <plugin>

命令的用途。请参阅命令行参考 http://www.grails.org/doc/latest/

For Grails 2.x, that's what the

grails install-plugin <plugin>

and

grails uninstall-plugin <plugin>

commands are for. See the command line reference at http://www.grails.org/doc/latest/.

暗地喜欢 2024-09-06 09:52:44

嗯,我知道这是一个老问题,但在这里说一下,从 Grails 2.0 开始,安装插件的最佳方法是更新 BuildConfig.groovy,将其添加到插件中可能是个好主意部分:

    plugins {
        // ....
        compile ":console:1.2"
    }

用于安装/卸载插件的脚本已被弃用,并且可能会被删除,因为它们存在有关范围和传递依赖项的问题。

如果要安装不在中央存储库中的插件,可以使用 grails install 然后您就可以以相同的方式在应用程序中使用它。

Well, I know this is an old question, but it's probably a good idea to say here that since Grails 2.0, the best way to install a plugin is to update BuildConfig.groovy, adding it in the plugins section:

    plugins {
        // ....
        compile ":console:1.2"
    }

The scripts for installing/uninstalling plugins are deprecated and will likely be removed because they have issues regarding scopes and transitive dependencies.

If you want to install a plugin that is not in the central repositories, you can install the plugin in your Maven cache with grails install and then you'll be able to use it in your applications the same way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文