Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven deploy the EAR as an exploded archive to the app server

Is there a way to deploy the EAR as an exploded archive to the app server ex. JBoss AS7 in Maven?

like image 623
kds Avatar asked Oct 28 '25 09:10

kds


1 Answers

After some research found the way to handle this.

In the ear project pom.xml add the following pluig-in

<plugin>
    <version>2.8</version>
    <artifactId>maven-ear-plugin</artifactId>
    <groupId>org.apache.maven.plugins</groupId>
    <configuration>
        <unpackTypes>rar,war,ejb</unpackTypes>
    </configuration>
</plugin>
  • In the maven goal set clean package
  • Then copy the exploded folder which is in the target to jboss deployment folder.
  • Add .ear extension into the exploded archive

Once this is done,

  • Add auto-deploy-exploded="true" in the standalone.xml deployment-scanner element
  • When start the Jboss it will auto deploy the exploded ear

Now you can add any static files or java class which will get auto deployed

However, This is not reccommedned in the production environment.

Best practice is,

In the meven goal set the clean package and it will generate the .ear archive file. You can either copy in to the deployment folder or using maven jboss-as:deploy plugin you can deploy it automatically.

like image 163
kds Avatar answered Oct 30 '25 13:10

kds