用Maven和Eclipse Helios创建完整的EAR项目 [英] Create complete EAR Project with Maven and Eclipse Helios

查看:108
本文介绍了用Maven和Eclipse Helios创建完整的EAR项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读了一些关于如何设置eclipse和maven的文章,以创建一个新的空耳朵项目,但是所有的解决方案都不完整,或者是旧的。

I read some articles about how to set up eclipse and maven to create a new empty ear project but all solutions weren't complete or are to old.

相信我需要创建三个pom.xml文件或三个项目:

I believe that I need to create three pom.xml files / or three projects:


  1. 具有WEB-APP结构的客户端项目(如常规动态Web项目)。
    这应该导致一个WAR文件。

  2. 服务器项目与ejbs。这应该是一个JAR文件。

  3. ear项目,将两个项目合在一起。

我尝试在eclipse中的集成的maven插件的帮助。由于(我相信Helios)的maven已经融入了日食。所以我去

I tried that with help of the integrated maven plugin in eclipse. Since (I believe Helios) maven is already integrated in eclipse. So I go to

文件 - >新 - > maven - > maven项目

file -> new -> maven -> maven project

并离开创建一个简单的项目复选框未选中。在另一边我得到了原型目录。要创建客户端项目,我查找了maven-archetype-webapp版本1.0。
但是所有的文件夹,如WebContent\META-INF等。

and leave the "create a simple project" checkbox unchecked. On the next side I got the archetype catalog. To create the client project I looked for maven-archetype-webapp Version 1.0. But all the folders like WebContent\META-INF etc. are missing.

那么我如何创建所有三个项目,一起构建?

So how can I create all three projects are build them together?

非常感谢
Hauke

Thanks a lot, Hauke

PS:我读到有关创建没有maven的项目5668710并激活依赖关系管理。但这是正确的方法吗?我不这么认为。

PS.: I read in question 5668710 about creating the project without maven and activate the dependency management. But is that the right way? I don't think so.

推荐答案

通过控制台创建项目并通过 m2eclipse 导入它们将是最好的方法,您可以在问题的评论中阅读它。

Creating the projects via console and importing them via m2eclipse would be the best way, as you can read it in the comments of your question.

在您的控制台中使用此行开始

Start off with this line in your console

mvn archetype:generate

然后使用原型 maven-archetype-j2ee-simple

这将为您生成 ejb ear web的项目结构项目。否则,您可以自行创建3个简单的项目 maven-archetype-quickstart ,并添加协调插件

This will generate you a project structure for ejb, ear and web projects. Otherwise you can create 3 simple projects maven-archetype-quickstart on your own and add the concering plugins

  • maven-ear-plugin
  • maven-ejb-plugin
  • maven-war-plugin

这是另一篇文章,处理您的问题:

Here is another post, handling your problem: Maven2: Best practice for Enterprise Project (EAR file)

另一个很好的例子,你可以找到< a href =http://agoncal.wordpress.com/2009/10/23/because-i-always-forget-how-to-use-maven-ear-plugin/ =nofollow noreferrer>这里

Another nice example you can find here

这篇关于用Maven和Eclipse Helios创建完整的EAR项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆