配置好maven后,找不到 POM.xml?

发布于 2022-09-07 03:59:00 字数 1688 浏览 13 评论 0

系统是Windows 10 家庭版

我按照官网的指引(https://maven.apache.org/guid...),下载了压缩包,解压后配置了PATH目录

输入

mvn -v

后,显示如下

Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: D:\apache-maven-3.5.3\bin\..
Java version: 10, vendor: Oracle Corporation
Java home: D:\java\jdk
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

然后我尝试进行第二步

mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

按照官网的说法,应该会生成一个目录,但是我这边却提示说

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM D:\_project\test\pom.xml: input contained no data @

 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project  (D:\_project\test\pom.xml) has 1 error
[ERROR]     Non-readable POM D:\_project\test\pom.xml: input contained no data
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

我打开 Help 1 的链接后也没有说怎么配置默认的POM文件,网上也没有找到解决方法

谢谢大家!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

戈亓 2022-09-14 03:59:00

原因是下面的pom.xml已经存在,删除这个pom.xml,重新测试即可

D:\_project\test\pom.xml
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文