Grails插件的依赖关系 [英] Grails Plugin dependencies

查看:125
本文介绍了Grails插件的依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建依赖于其他插件的插件时,可以通过 dependsOn 地图在插件的配置中指定这些依赖项。

我想知道的是,如果在运行install-plugin命令时自动下载这些插件?
如果没有,那么它是如何设置的?

解决方案

这就是它在1.2和1.3中的工作原理。但在2.0中,您需要在 BuildConfig.groovy 插件部分配置依赖关系,因为 dependsOn 不填充pom文件,这就是2.0中依赖管理的用途。

1.3也可以在BuildConfig中使用依赖关系。 groovy,但1.2和更早版本不能。我认为可以安全地假设1.2或更低版本的用户不多,但如果您需要支持较早的版本,则可以在安装插件之前包含说明,以便明确安装所需的依赖项。


When creating a plugin that depends on other plugins, you specify these dependencies in the config of the plugin via the dependsOn map.

What I want to know is if these plugins are downloaded automatically when you run install-plugin command?? If not, how can it be set up to do so?

解决方案

That's how it works in 1.2 and 1.3. In 2.0 however you'll want to configure dependencies in the plugins section of BuildConfig.groovy since dependsOn doesn't populate the pom file and that's what's used for dependency management in 2.0.

1.3 can also work with dependencies in BuildConfig.groovy, but 1.2 and earlier cannot. I think it's safe to assume that there aren't many users still on 1.2 or earlier, but if you need to support older versions you can just include instructions for them to explicitly install the required dependencies before installing your plugin.

这篇关于Grails插件的依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆