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

系统是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文件,网上也没有找到解决方法

谢谢大家!

阅读 9.1k
1 个回答

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

D:\_project\test\pom.xml
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题