Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
760 views
in Technique[技术] by (71.8m points)

web applications - Create complete EAR Project with Maven and Eclipse Helios

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.

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

  1. client project with the WEB-APP structure (like a regular dynamic web project). This should result in a WAR file.
  2. server project with the ejbs. This should be a JAR file.
  3. ear project which joins both projects together.

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

file -> new -> maven -> maven project

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 WebContentMETA-INF etc. are missing.

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

Thanks a lot, Hauke

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

Then use the archetype maven-archetype-j2ee-simple

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

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

Another nice example you can find here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...