Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create ear file, and include war and jar files inside that

I am trying to create an EAR file from the command prompt. I have used

jar -cvf myServletWAR.ear . 

But my question is, how can I get this EAR file to have WAR files and JAR files inside it?

Do I need to create the war file separately and include in the ear file?

I can't use the ANT file for this, as there are few restrictions on this project.

like image 599
gmhk Avatar asked Mar 04 '13 08:03

gmhk


People also ask

Can WAR files be nested into EAR files?

No, that is not valid. An EAR file may contain other module-level archives, such as WAR, EJB JARs, RARs, or library JARs, but it may not contain other EAR files.

How do you add WAR dependency in EAR POM xml?

You can change the specific configuration values for the webModule as required. Now create a parent module (with <packaging>pom</packaging> ) and add the war module and the ear module to it. Make sure you set the <parent> of the war and ear modules corrently.


1 Answers

One of my EAR files has structure as follows:

app.ear
  - APP-INF
    - lib
      // libraries (.jar) here
  - META-INF
    - MANIFEST.MF
    - weblogic-application.xml
  - module1.war
  - customlib.jar

This archive is being deployed onto WebLogic 10.3.

Remeber .ear is just a ZIP file, so you can always create it this way, although it seems messy.

like image 103
kamituel Avatar answered Sep 20 '22 14:09

kamituel