Maven not downloading dependencies in Eclipse

后端 未结 11 1467
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 19:08

I am setting up a project in eclipse . This projects builds successfully through command line(all mvn commands like mvn package, mvn compile<

11条回答
  •  北荒
    北荒 (楼主)
    2021-01-03 19:35

    Make sure you're defining the dependency as close as possible to the leaf of the project tree where it is needed. Otherwise, Maven might ignore it.

    For example, if you have a parent project that references projects A and B and the dependency is with respect to project A, then defining the dependency in the parent's pom.xml might get ignored by Maven. So, define it in project A's pom.xml.

    Parent Project's pom.xml
       Sub-project A's pom.xml <<< define the dependency where it is needed
       Sub-project B's pom.xml
    

提交回复
热议问题