Super POM, Parent POM type of hierarchy management in Gradle

前端 未结 3 1887
没有蜡笔的小新
没有蜡笔的小新 2021-02-20 17:36

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 part
相关标签:
3条回答
  • 2021-02-20 17:43

    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.

    0 讨论(0)
  • 2021-02-20 17:51

    Instead of the super POM, you'd write a Gradle plugin and distribute that. Not exactly sure what you get out of 2. and 3., but if these definitions are reused between builds, they would again go into a plugin, and otherwise into a parent build script.

    0 讨论(0)
  • 2021-02-20 17:51

    You can convert the Parent pom content in to Gradle init file very easily.

    You need to take

    • repository,
    • distribution management
    • profiling
    • other checks like findbugs, checkstyle etc

    in to init script.

    The detail is huge, You can find complete information here by me.

    http://www.scmtechblog.net/2015/12/how-to-migrate-parent-pom-from-maven-to.html

    0 讨论(0)
提交回复
热议问题