如何将插件依赖项添加到pom.xml [英] How to add plugin dependencies to pom.xml

查看:264
本文介绍了如何将插件依赖项添加到pom.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个具有其他插件的插件,作为BuildConfig.groovy中的插件依赖项:

I have created a plugin which has other plugins as plugin dependencies in BuildConfig.groovy:

grails.project.dependency.resolution = {
    ....
    plugins {
        build(":release:3.0.0",
            ":rest-client-builder:1.0.3") {
             export = false
        }

        // my dependencies
        compile ':spring-security-core:1.2.7.2'
        compile ":spring-security-ldap:1.0.6"
    }
}

如何确保当有人安装我的插件时,他们不必手动安装spring-security-corespring-security-ldap?我希望依赖管理为他们做.

How can I make sure that when someone installs my plugin they don't have to install spring-security-core and spring-security-ldap manually? I want dependency management to do it for them.

Grails 2.3.0

Grails 2.3.0

推荐答案

您已经正确配置了它.不会安装release和rest-client-builder构建器插件,因为它们已正确配置为无法导出,但是安全插件已导出,因为默认情况下所有依赖项都已导出.

You've already configured it correctly. The release and rest-client-builder builder plugins won't be installed because they're correctly configured to not be exported, but the security plugins are exported since all dependencies are exported by default.

您可以通过运行grails generate-pom并查看生成的pom.xml文件来查看. jar和插件的依赖项位于<dependencies>块中,并且<dependency>块中的"org.grails.plugins" groupId项中应包含任何传递性插件依赖项.

You can see this by running grails generate-pom and viewing the generated pom.xml file. The jar and plugin dependencies are in the <dependencies> block, and there should be entries in <dependency> blocks for the "org.grails.plugins" groupId for any transitive plugin dependencies.

这篇关于如何将插件依赖项添加到pom.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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