dependencyManagement - imports and direct entries in parent poms

喜夏-厌秋 提交于 2019-12-13 17:22:52

问题


My project and my parent pom both have a dependency management section. These sections both have direct entries and "imports" of boms (i.e. poms that purely consist of dependecyManagement and are imported). Now I try to figure out the evaluation order. My best guess:

  1. parent pom imports
  2. child pom imports
  3. parent pom direct dependencyManagement entries
  4. child pom direct dependencyManagement entries

This means that later elements overwrite earlier elements. Is this correct? If so, can I change this behaviour so that the child elements always overwrite the parent elements?


回答1:


Following the ticket

issues.apache.org/jira/browse/MNG-5971

it is indeed true that direct management entries cannot be overwritten by imports in child projects. This behaviour should be altered in Maven 3.6.0, according to the statements in the ticket.

As Maven 3.6.0 is distant future, I have to work around this problem. I will probably avoid direct management entries in the parent pom by constructing an auxiliary bom.



来源:https://stackoverflow.com/questions/42339668/dependencymanagement-imports-and-direct-entries-in-parent-poms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!