Maven实战错误笔记:使用mvn archetype:generate报错:Unable to add module to the current project as it is not of packaging type 'pom'

时间:2024-01-02 08:49:08

在使用mvn archetype:generate生成Maven实战03:HelloWorld中的HelloWorld的项目骨架时报了这个错,从字面上分析是可能与pom.xml文件有关,然后我看了一下我命令行的打开位置,果然在项目根目录下,里面刚好有个pom.xml,如果在这里构建骨架,又要用pom.xml文件,是会不成功的,就会报Unable to add module to the current project as it is not of packaging type 'pom'这个错,然后我选择在项目目录构建,就成功了,这个是我自己的解决方法,成功了的。