超级POM,Gradle中父级POM类型的层次管理 [英] Super POM, Parent POM type of hierarchy management in Gradle

查看:157
本文介绍了超级POM,Gradle中父级POM类型的层次管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前使用Maven作为我们的构建工具,并且有一条指令可以迁移到Gradle。我们目前的设置是:


  1. 我们有一个超级POM,它定义了所有第三方依赖项,各种插件,distributionManagement URLs,并且这个POM被上传到我们的发布回购。

  2. 我们有一个聚合器POM,它使用这个超级POM作为父级,并聚合了几个子模块。 POM来构建组件。

我的问题是,在Gradle中执行所有这些操作的最佳方法是什么?如何在单个Gradle配置中定义所有第三方依赖关系,并在其他地方使用它。



我是Gradle的新手,因此这可能听起来很愚蠢。但我要求所有人提供一些帮助和指导。

解决方案

我做到以下几点:




  • 定义一个gradle脚本(类似父pom)
  • 在我的build.gradle中应用它file



    适用于:'https://youUrlHere/parent.gradle'




欲了解更多信息,请点击此处:

希望这有帮助。



We are currently using Maven as our build tool and there is a directive to migrate to Gradle. Our current setup is:

  1. We have a super POM that defines all third party dependencies, various plugins, distributionManagement URLs and this POM is uploaded to our releases repo.
  2. We have an aggregator POM that uses this super POM as parent and aggregates several submodules.
  3. We have several profiles defined in aggregator POM to build components.

My question is, what is the best way to do all these in Gradle. How can I define all third party dependencies in a single Gradle config and use it in other places.

I am new to Gradle and so, this might sound a very stupid question. But I request all to provide some help and guidance.

解决方案

I do the following:

  • Define a gradle script (something like a parent pom)
  • Apply it (something like extending) in my build.gradle file

    apply from: 'https://youUrlHere/parent.gradle'

For more info, you can have a look here: http://forums.gradle.org/gradle/topics/inheriting_from_a_parent_not_in_the_same_project

Hope this helps.

这篇关于超级POM,Gradle中父级POM类型的层次管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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