eclipse maven 安装错误 - 在开始标记之前只允许空白内容而不是 \u0
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13929633/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
maven install error - only whitespace content allowed before start tag and not \u0
提问by Lucky
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-install) on project ecommerce-web: Failed to install metadata com.app:ecommerce-web/maven-metadata.xml: Could not parse metadata C:\Users\admin\.m2\repository\com\app\ecommerce-web\maven-metadata-local.xml: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) -> [Help 1]
there is nothing in my maven-metadata-local.xml
我的 maven-metadata-local.xml 中没有任何内容
what is the problem?
问题是什么?
回答by Ilya
The problem is in file ecommerce-web/maven-metadata-local.xml
, it contains char(0)
(or null
char, or Unicode: 0x0
).
Clean all local repository, or delete folder with com.app:ecommerce-web
artifact
问题出在 file 中ecommerce-web/maven-metadata-local.xml
,它包含char(0)
(或null
char,或 Unicode: 0x0
)。
清理所有本地存储库,或删除带有com.app:ecommerce-web
工件的 文件夹
There is nothing in my maven-metadata-local.xml
我的 maven-metadata-local.xml 中没有任何内容
It's not true. Open your file with Notepad++ and you will see many null
s
这不是真的。用记事本打开文件++和你会看到许多null
小号
回答by RTS
Just go under
就下
C:\Users\admin\.m2\repository\com\app\ecommerce-web\
and delete maven-metadata-local.xml
Then do a clean install one more time, this should fix the problem and that's what I did.
并删除maven-metadata-local.xml
然后再进行一次全新安装,这应该可以解决问题,这就是我所做的。
回答by Singh Arun
It's because of character encoding issue. It doesn't appear when we open file in UTF-8encoded format.
这是因为字符编码问题。当我们以UTF-8编码格式打开文件时,它不会出现。
To mitigate this issue, open file in notepad++and select encoding as "Encode in ANSI". You will see many BOM characters. Remove them manually and save it again. It works.
要缓解此问题,请在notepad++ 中打开文件并选择编码为“在 ANSI 中编码”。您将看到许多BOM 字符。手动删除它们并再次保存。有用。
回答by Neha Agarwal
Delete all folders under app folder C:\Users\admin.m2\repository\com\app and then clean build project
删除 app 文件夹 C:\Users\admin.m2\repository\com\app 下的所有文件夹,然后清理构建项目
回答by Chanaka Fernando
I also had this experience. The simple solution was deleting the relevant content of the .m2folder and local repofolder and build again using mvn clean install(Please make sure backup your important data :))
我也有过这样的经历。简单的解决方案是删除.m2文件夹和本地 repo文件夹的相关内容,然后使用mvn clean install重新构建(请确保备份您的重要数据:))
回答by Indika Herath
Please backup your .m2 file when it working properly. In case you get above mentioned issue. you can replace the .m2 file which you have got backup. The issue can happen when corrupt the m2 file when occur the power cut kind of issue in advance. Then you wont get same issue again and again.
请在它正常工作时备份您的 .m2 文件。如果您遇到上述问题。您可以替换已备份的 .m2 文件。当提前发生停电类型的问题时,损坏 m2 文件时可能会发生此问题。那么你就不会一次又一次地遇到同样的问题。