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

后端 未结 6 1401
小蘑菇
小蘑菇 2021-02-05 08:17

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

6条回答
  •  囚心锁ツ
    2021-02-05 09:01

    If you want to create an ear from the command line, following are the options that you can try.

    Option 1. Using an ant build and use the ear task. Configure this ear task as stated in stackoverflow question on ant ear task usage

    Note: Maven based build is preferred over ant these days.

    Option 2. If you can use maven, configure your modules and use maven ear plugin to generate an ear. The below command will be able to generate the ear.

    mvn clean package
    

    Refer to the maven question regarding a Java EE project for more information on configuring war, jars for an ear.

提交回复
热议问题