超级POM,Gradle中父级POM类型的层次管理 [英] Super POM, Parent POM type of hierarchy management in Gradle
问题描述
我们目前使用Maven作为我们的构建工具,并且有一条指令可以迁移到Gradle。我们目前的设置是:
- 我们有一个超级POM,它定义了所有第三方依赖项,各种插件,distributionManagement URLs,并且这个POM被上传到我们的发布回购。
- 我们有一个聚合器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:
- We have a super POM that defines all third party dependencies, various plugins, distributionManagement URLs and this POM is uploaded to our releases repo.
- We have an aggregator POM that uses this super POM as parent and aggregates several submodules.
- 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屋!