【问题标题】:Can a child pom inherit plugin management and dependency management from the spring-boot-starter-parent of a custom parent pom?子 pom 可以从自定义父 pom 的 spring-boot-starter-parent 继承插件管理和依赖管理吗?
【发布时间】:2019-10-23 01:42:26
【问题描述】:

假设,我有一个以 spring-boot-starter-parent 作为其父级的自定义父级 pom。这个自定义父级的子 pom 是否能够从 spring-boot-starter-parent 继承插件管理和依赖管理?

据我所知:如果我们使用自定义父级,我们无法使用 spring-boot-starter-parent 的插件管理功能,但可以通过将 spring-boot-dependencies 作为 BOM 导入来使用依赖项管理。但是说 - 我的自定义父级将 spring-boot-starter-parent 作为其父级 - 这个自定义父级的子 pom 是否能够通过传递依赖项继承/使用 spring-boot-starter-parent 的依赖项和插件管理功能机制?我认为可以,但我不是 100% 有信心。我仍然是 Maven 的新手,我无法完全理解这一点。请帮忙解释一下。

【问题讨论】:

  • 嗨@SimonMartinelli,是的,我已经读过了。但是,这里没有提到从自定义父级继承起始父级的任何内容,这是我的主要疑问。
  • 你试过了吗?
  • 嗨,西蒙,谢谢。我尝试并可以获取依赖项和插件管理。有时,甚至想都不想,我倾向于用勺子喂食。这是一个教训。谢谢,如果您对这个问题还有什么要说的,请告知。
  • 很好用。我添加了我的评论作为答案。如果您能接受,我将不胜感激。谢谢

标签: maven spring-boot spring-boot-starter


【解决方案1】:

继承有效。您可以简单地尝试一下。

官方文档供你参考:

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-maven-without-a-parent

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-18
    • 2016-12-17
    • 2019-10-16
    • 2015-08-02
    • 2012-12-27
    • 2021-07-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多