IDE Integration
参考 Maven – Apache Maven IDE Integration 文档,以获取在 IDE 中集成 Maven 的方法,以及常见问题的解决办法;
m2eclipse for Eclipse
注意事项:
1)部分 IDE 默认会集成 Maven,而非使用我们在系统中安装的 Maven 环境(在排查问题时需要注意);
在 Eclipse 中,可以手动修改 pom.xml 为 Maven 项目添加依赖包。
针对 Maven 项目,添加依赖
java – How do I add a Maven dependency in Eclipse? – Stack Overflow
如果对 pom.xml 格式不熟悉
我们也可以使用 Eclipse 按照如下方法添加:
第一步、索引 Maven 仓库
Window => Show View => Other => Maven => Maven Repositories
在新的窗口中,右击 Global Repositories => Go Into
右键 “central (http://repo.maven.apache.org/maven2)”%EF%BC%8C%E9%80%89%E6%8B%A9 Rebuild Index 并等待索引完成;
第二步、添加依赖信息
当索引完成后,右键项目 => Maven => Add Dependency,然后输入依赖的信息;