新建maven时报错-----------解决:换一个工作空间,或者将工作空间的pom.xm删除
2016-04-22 09:29
302 查看
今天学习在本地搭建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了。
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了。
相关文章推荐
- Hibernate 单向多对一&单向一对多&单向多对多
- android 布局属性大全
- 1031. Hello World for U (20)
- MATLAB im2colstep
- OpenKM开发环境搭建
- 一个类似MIUI中原生短信编辑功能
- MVC 自定义IModelBinder实现json参数转Dictionary<string, string>
- 青云 ubuntu下mysql远程连接配置
- Java Error: java.lang.UnsupportedClassVersionError: ...bad major version at offset=6
- 性能测试负载模型(二)
- 科比告别赛致大众,尤其深刻意向那一句“man”,全场沸腾
- CocoaLumberjack和XcodeColors定制个性化log系统
- Visualizations&plot&pivot_table
- 51nod 125乘法逆元 (扩展欧几里得)
- uva 10673 Play with Floor and Ceil 数学
- android paint 研究总结
- 自定义View实现图片缩放
- 在应用程序中播放音频和视频
- 翻译漫谈笔记之3翻译的步骤及其特点
- 如何自学Android