Scanning errors (1): 1 Could not read pom.xml

我的pom.xml文件是去掉下面的部分,然后错误消失:


    org.apache.maven.plugins
    maven-compiler-plugin
    3.1
    
        1.8
        1.8
    

解决方法:

(1)出现这种问题肯定是pom.xml有问题,先自己过一遍,有没有特别明显的问题,比如标签不完整,等。

Scanning errors (1): 1 Could not read pom.xml_第1张图片

 (2)如果找不到上面的错误,就打开文本编辑器,把pom.xml中的标签一部分删除,然后eclipse中重新导入,看问题是否还存在。

如我先删除的内容

Scanning errors (1): 1 Could not read pom.xml_第2张图片

重新导入,直接在文件下拉框来回切换选择文件就行。

Scanning errors (1): 1 Could not read pom.xml_第3张图片

还是同样的问题。我们maven是父子结构,三个项目,正常导入是会出现三个por.xml 的。

Scanning errors (1): 1 Could not read pom.xml_第4张图片

然后去掉标签,还是没解决。就是这样一块一块去,去排除出现问题的地方。

最后我把标签去掉,问题解决,第三个pom.xml出现

Scanning errors (1): 1 Could not read pom.xml_第5张图片

 Scanning errors (1): 1 Could not read pom.xml_第6张图片

 

你可能感兴趣的:(报错)