您的位置:首页 > 其它

错误整理:Unable to add module to the current project as it is not of packaging type 'pom'

2013-03-06 17:02 926 查看
今天在eclipse中新建Maven工程,怎么建都报如下错误。

Unable to create project from archetype [org.apache.maven.archetypes:maven-archetype-quickstart:1.1]

Unable to add module to the current project as it is not of packaging type 'pom'

一开始以为是IDE出错了,很是着急,后来回想出错之前的操作。就在这之前,我备份了一个pom文件,然后直接移到了workspace的根目录下,心想是不是这个问题呢?带着疑问,我把这个pom.xml删掉了,然后再创建maven工程,果然不出所料,不再报错了。

为了确保是这个原因,后来google了一下,在国外一个论坛中碰到类似的问题,有个网友的回答摘抄如下:

Are you running the command from a directory that has an existing pom.xml file in it? I think that may be confusing Maven, as it thinks you're trying to add your new project as a sub-module of the project in the working
directory.

原来是因为我在Workspace下放了个POM文件,造成了M2eclipse插件的误解,删掉就OK了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐