在 Eclipse Kepler EE 中创建 Maven 项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20609700/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 21:59:24  来源:igfitidea点击:

Creating Maven project in Eclipse Kepler EE

eclipsemaven

提问by khateeb

I am completely new to Maven. I am using Eclipse Kepler EE edition. I want to create a Maven project and convert it into a Java EE project. I need a step-by-step explanation of the process. I would prefer if I didn't have to use the command line.

我对 Maven 完全陌生。我正在使用 Eclipse Kepler EE 版。我想创建一个 Maven 项目并将其转换为 Java EE 项目。我需要对过程的逐步解释。如果我不必使用命令行,我会更喜欢。

Thanks.

谢谢。

回答by Saif Asif

I want to create a Maven project and convert it into a Java EE project.

I want to create a Maven project and convert it into a Java EE project.

You can work in either way. Lets look at the possibilities

你可以以任何一种方式工作。让我们看看可能性

  1. Create a new project (Dynamic web project) and add any facets you want in the JEE project. How To :Once project is setup, simply right click on the project--> Configure--> convert to maven project, specify the artifactID along with the groupID and you are done !
  2. Instead of making a dynamic project, just setup a blank maven project first and then add the facets afterwards. How To :In Eclipse, New Project--> maven project--> Blank project ( skip archetype selection ), specify groupdID and artifactID and you're done. After wards just add the facets once the project is setup by righ-clicking the newly created maven project --> Properties--> facets
  3. Lastly you can use archetypes. Archetypes are re-build/configured maven projects that can be used directly since they come pre-configured with whole set of jars, facets and build path entries. Take a look into the list here. How To :In eclipse New project--> New maven project--> archetype--> specify name of archetype and voila! You're done !
  1. 创建一个新项目(动态 Web 项目)并在 JEE 项目中添加您想要的任何方面。如何:一旦项目设置好,只需右键单击项目-->配置-->转换为 maven 项目,指定 artifactID 和 groupID 就完成了!
  2. 无需创建动态项目,只需先设置一个空白的 maven 项目,然后再添加 facet。如何:在 Eclipse 中,新建项目--> Maven 项目-->空白项目(跳过原型选择),指定 groupdID 和 artifactID 就完成了。之后只需通过右键单击新创建的 maven 项目 -->属性-->面,在项目设置后添加构
  3. 最后,您可以使用原型。原型是重新构建/配置的 Maven 项目,可以直接使用,因为它们预先配置了一整套 jar、facet 和构建路径条目。看看这里的列表。如何:在 Eclipse 中新建项目-->新建 Maven 项目-->原型--> 指定原型名称,瞧!你完成了 !

回答by Andreas

File --> New --> other --> J2EE --> WHATEVER J2EE Type of Project you want

File --> New --> other --> J2EE --> WHATEVER J2EE Type of Project you want

After that you Right-Click the project and goto Configure -> Convert to maven project

之后,您右键单击该项目并转到 Configure -> Convert to maven project

You can also use Configure -> Convert to Faceted formand activate the facets you want for your J2EE Project from the project properties.

您还可以Configure -> Convert to Faceted form从项目属性中为 J2EE 项目使用和激活所需的方面。

Properties -> Project Facets

Properties -> Project Facets

I hope this will get you started.

我希望这会让你开始。

回答by msenni

You can start by installing the Eclipse plugin Maven Integration for WTP. The plugin is a good starting point. Some understanding on Maven topics like plugins, goals would help you in a great way for creating a Maven project from scratch. Have a look at the getting started guide.

您可以从安装 Eclipse 插件Maven Integration for WTP 开始。该插件是一个很好的起点。对 Maven 主题(如插件、目标)的一些了解将有助于您从头开始创建 Maven 项目。查看入门指南

Since you are looking for a Java EE project I am guessing you are looking to generate an EAR file for which you can use this Apache Maven EAR Plugin

由于您正在寻找一个 Java EE 项目,我猜您正在寻找生成一个可以使用此Apache Maven EAR 插件的 EAR 文件