如何将pom.xml添加到现有的Eclipse项目中?

时间:2021-11-05 10:43:33

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.

我是Maven的新手并使用Eclipse Juno。我已经安装了Maven Integration for Eclipse。文件>新建>其他> Maven中有三个选项:1。从SCM检出Maven项目2. Maven模块3. Maven项目但我没有看到如此处所述的Maven2 POM。我已经读过添加pom.xml是使用Maven时要做的第一件事。

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

我有一个现有的动态Web项目,所以我不确定是否需要创建Maven项目才能使用Maven。

How to use Maven with this existing project?

如何在现有项目中使用Maven?

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.

此外,当我尝试添加Maven项目并在步骤“选择一个原型”时,所有显示的原型都有版本“RELEASE”。当我在此步骤中单击“下一步”时,Eclipse将变为“无响应”。它的使用内存甚至没有增加。

2 个解决方案

#1


32  

Take a look here :

看看这里:

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

在最后一个版本的eclipse(包括Juno)中,有一个更方便的向导:

Configure > Convert to maven project

#2


8  

You need to import the project as a Maven project.

您需要将项目导入为Maven项目。

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

#1


32  

Take a look here :

看看这里:

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

在最后一个版本的eclipse(包括Juno)中,有一个更方便的向导:

Configure > Convert to maven project

#2


8  

You need to import the project as a Maven project.

您需要将项目导入为Maven项目。

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