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.
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.
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.
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.
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