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:
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 WebContent\META-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.
You can create an EAR project using File > New > Enterprise Application Project. Change the JavaEE version to JavaEE 6 for deployment to JBoss 7. x, enable the 'Add maven support' and in the next page, select the already created maven project as module to add to the EAR project.
Create a new Maven project in Eclipse. From the File menu, choose New, and then choose Project. In the New Project window, choose Maven Project. In the New Maven Project window, choose Create a simple project, and leave other default selections.
This plugin generates Java EE Enterprise Archive (EAR) file. It can also generate the deployment descriptor file (e.g. application. xml ).
Using Maven with the Eclipse IDEThe Eclipse IDE provides support for the Maven build. This support is developed in the M2Eclipse project. It provides an editor for modifying the pom file and downloads dependencies if required. It also manages the classpath of the projects in the IDE.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With