简体   繁体   English

M2eclipse依赖项解析

[英]M2eclipse dependency resolution

I notice that m2eclipse doesn't automatically add transitive dependencies to a project's build path... 我注意到m2eclipse不会自动将传递性依赖项添加到项目的构建路径中...

For instance, if "Project A" specifies "Library X" as a dependency which, in turn, depends on "Library Y", I cannot use "Library Y" in "Project A" unless I also explicitly specify "Library Y" as a dependency the pom.xml. 例如,如果“ Project A”将“ Library X”指定为依赖项,而依赖关系又依赖于“ Library Y”,则除非我将“ Library Y”明确指定为“ Library Y”,否则我不能在“ Project A”中使用“ Library Y” pom.xml的依赖项。

Is this by design? 这是设计使然吗? Or a flaw in m2eclipse? 还是m2eclipse中的缺陷?

It certainly does add transitive dependencies. 它确实确实增加了传递依赖。 Note it's now called m2e . 请注意,它现在称为m2e Your dependencies need to be specified in the POM. 您的依赖项需要在POM中指定。 If you're not used to Maven, you might be adding the dependencies by hand using Eclipse's build path tools. 如果您不习惯Maven,则可能是使用Eclipse的构建路径工具手动添加了依赖项。 You don't need to do this any more. 您不再需要这样做。 Just right click on the project and do Maven -> Update Project... and it will sort out the build path for you. 只需右键单击该项目,然后执行Maven-> Update Project ...,它将为您整理出构建路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM