kirti
kirti

Reputation: 71

Creating EAR file using Maven

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

Upvotes: 0

Views: 8530

Answers (2)

Sergio Puas
Sergio Puas

Reputation: 483

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

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

Upvotes: 0

Torsten
Torsten

Reputation: 24176

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.

Upvotes: 1

Related Questions