【idea导入maven不能识别pox中的包 】【IDEA导入maven nothing to show】
问题描述
针对IDEA Maven项目的两个问题:
1. 虽然在external libraries里有jar包,但是代码中不能import
2. 从git导入maven项目时,显示nothing to show而不能finish
都是IDEA导入项目时选项选择错误的造成的。
解决方案
1. 如果是git仓库的项目是工作集,要勾选search for projects recursively
如 根目录
|-----项目1
|-----项目2
|-----项目3
此时的pox.xml在根目录下没有,只有递归找到,才能成功构建maven项目
2. Import maven projects automatically 勾上
3. 如果需要依赖包和文件也勾上 倒数第二行Sources和Documentation
附:参考图片来自