0

I have a maven project which currently creates a war package on build. Now I need to bundle it as an ear project. Any pointers on how to do this. I added the m2e plugin and modified the pom.xml file, but, i am not able to get the directory structure as expected. I need the dir structure as below

project-name
  - project-name.ear
  - pom.xml
  - project-name.war
  - projec-name.jar
  - META-INF/application.xml

Thanks.

Charlee Chitsuk
  • 8,847
  • 2
  • 56
  • 71
User
  • 135
  • 2
  • 4
  • 13
  • Pretty much a duplication of [the following](http://stackoverflow.com/questions/1134894/maven2-best-practice-for-enterprise-project-ear-file) – Oleg Sklyar Jan 10 '14 at 20:02

1 Answers1

0

It is strongly recommend that you organize your project structure in proper Maven style:

project-name/
  - pom.xml  (POM of project-name, multi-module POM)
  + project-name-jar
    - pom.xml  (main app JAR)
  + project-name-web
    - pom.xml  (WAR project to construct WAR by project-name-jar etc)
  + project-name-ear
    - pom.xml  (EAR project to construct EAR by project-name-war etc)

Normally I will have another child project call project-name-parent which use as parent POM for the whole project.

In Maven, you don't and you shouldn't have META-INF/application.xml as part of your source. It is generated dynamically base on configuration of maven-ear-plugin.

Adrian Shum
  • 38,812
  • 10
  • 83
  • 131