Differences between dependencyManagement and dependencies in Maven

前端 未结 13 1123
北荒
北荒 2020-11-22 04:14

What is the difference between dependencyManagement and dependencies? I have seen the docs at Apache Maven web site. It seems that a dependency def

13条回答
  •  清酒与你
    2020-11-22 04:52

    In the parent POM, the main difference between the and is this:

    Artifacts specified in the section will ALWAYS be included as a dependency of the child module(s).

    Artifacts specified in the section will only be included in the child module if they were also specified in the section of the child module itself. Why is it good you ask? because you specify the version and/or scope in the parent, and you can leave them out when specifying the dependencies in the child POM. This can help you use unified versions for dependencies for child modules, without specifying the version in each child module.

提交回复
热议问题