执行 maven 命令 报错Unable to add module to the current project as it is not of packaging type 'pom'[转]
2015-05-31 15:49
926 查看
今天学习在本地搭建Maven工程时,执行了mvn archetype:generate 命令,报错。
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了。
转自:http://blog.csdn.net/yang_734664103/article/details/15783745
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了。
转自:http://blog.csdn.net/yang_734664103/article/details/15783745
相关文章推荐
- TalkingData美国旧金山之行 —— Twitter
- Internal Sorting: Straight selection sort: Sorting by Selection
- ListView的优化
- Python之学习笔记(模块的使用)
- Struts2中获取请求参数
- Unity中用触摸控制物体旋转和放大
- A*算法完全理解
- java final域
- I/O模型与Nginx配置
- 博客第一天......
- centos 7 重置root密码
- Java的引用类型(附图说明)
- jstack,用于检测死锁
- solr DataImportHandler (数据相关操作)
- WF入门
- Java笔记--集合
- Java笔记--异常
- 【Unity3D】枪战游戏—弹孔设置
- android开发环境搭建
- Nuch 1.2 +tomcat window下 搭建简单的搜索引擎