其他分享
首页 > 其他分享> > IntelliJ idea:The markup in the document preceding the root element must be well-formed

IntelliJ idea:The markup in the document preceding the root element must be well-formed

作者:互联网

现象:

打开iIntellJ idea时,突然发现Web前端的maven工程在左侧项目栏看不到了,也无法通过引入pom文件的方式重新导入工程。发生错误时的idea页面如下图。错误信息为:Cannot load setting from file 'F:\Idea2017\...\xxx-web.iml': Error on line: The makup in the document preceding the root element must be well-formed. Please correct the file content。

根据提示找到相应的"xxx-web.iml"文件后,打开文件,发现文件是这样的:

 

原因:

据个人猜测,也许是svn更新的时候发生了冲突,导致xxx-web.iml文件错乱。idea在读取iml文件加载maven项目的时候,由于无法正确的解析"xxx-web.iml"文件,导致idea无法加载出Maven项目。

解决方法:

删除多余的<module>元素和文件中冲突的行,重新打开IntellJ idea。删除后的文件如下图:

标签:文件,xxx,IntelliJ,web,preceding,formed,iml,idea,file
来源: https://blog.csdn.net/weixin_38085783/article/details/100580941