Why does a dependency with scope “provided” hide transitive dependencies in Maven?

前端 未结 3 1094
礼貌的吻别
礼貌的吻别 2021-02-05 18:01

I have three modules in my Maven project (this is slightly simplified):

  • model contains JPA annotated entity classes
  • persistence instanti
3条回答
  •  独厮守ぢ
    2021-02-05 18:24

    The dependencyManagement section declares what dependencies will look like if you use them, not that you will use them. So you still need to declare a minimal dependency declaration to have the configuration applied in your child project. See the dependency management section of the Maven book for details.

    The minimum required is typically the groupId and the artifactId.

    If you want to inherit the configuration without declaring it at all, you should define it in the parent's dependencies section rather than dependencyManagement

提交回复
热议问题