How to add pom.xml to existing Eclipse project?

那年仲夏 提交于 2019-12-04 08:53:35

问题


I'm new to Maven and use Eclipse Juno. I've installed Maven Integration for Eclipse. There are three options in File > New > Other > Maven:
1. Checkout Maven Projects from SCM
2. Maven Module
3. Maven Project

But I don't see Maven2 POM as described here. I've read that adding pom.xml is the first thing to do when using Maven.

I have an existing Dynamic Web Project so I'm not sure whether I need to create Maven Project just to use Maven.

How to use Maven with this existing project?

Further, when I try to add Maven Project and on step "Select an Archetype", then all shown archetypes have version "RELEASE". When I click Next on this step, Eclipse becomes Not Responding. It's used memory doesn't even increase.


回答1:


Take a look here :

  • http://www.mkyong.com/maven/how-to-convert-java-web-project-to-maven-project for a manuel convertion.
  • Convert Existing Eclipse Project to Maven Project

In last version of eclipse (Juno included), there is a more convinient wizard :

Configure > Convert to maven project



回答2:


You need to import the project as a Maven project.

File -> Import -> Maven -> Import existing Maven project.


来源:https://stackoverflow.com/questions/11818384/how-to-add-pom-xml-to-existing-eclipse-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!