0

I am facing an issue while creating EAR file using Maven of a Dynamic Web Project.

I have successfully created WAR file using POM.xml , but can anybody tell me how to write EAR script in POM.xml ?

Thanks in advance

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
kirti
  • 61
  • 2
  • 6
  • These SO topics might help: http://stackoverflow.com/questions/6829961/create-complete-ear-project-with-maven-and-eclipse-helios http://stackoverflow.com/questions/1134894/maven2-best-practice-for-enterprise-project-ear-file – rocketboy Aug 02 '13 at 11:19
  • Hello and welcome to stack overflow! you may find this link helpful to know how to properly ask questions correctly, so that they fit the expected community format: http://stackoverflow.com/help/how-to-ask – STT LCU Aug 02 '13 at 11:36

2 Answers2

1

It easy. You need:

  1. Root project, parent pom that have 2 modules - war and ear.
  2. Move your war to war module
  3. create ear module (add war as dependency)

You can use archetype:generate to create example of ear. For example archetype with id: 612.

612: remote -> org.jboss.spec.archetypes:jboss-javaee6-ear-webapp (An archetype that generates a starter Java EE 6 webapp project for JBoss AS 7. The project is an EAR, with an EJB-JAR and WAR)

If you don't need ejb - just delete it. In generated example ejb is optional.

Torsten
  • 21,726
  • 5
  • 24
  • 31
0

Check my archetype for maven, this is for Java EE 6

https://github.com/sjpuas/jee6-archetype

Sergio Puas
  • 454
  • 4
  • 10