How to add a custom JBoss archive in an Ear ?

User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

JBoss custom archives (like .sar or .har) are not recognized by the application.xml descriptors, so in order to deploy them in an EAR you have to declare them in jboss-app.xml. This file is located in the META-INF folder of your EAR.

For example, if you want to include an Hibernate Archive (HAR), you have to provide the following jboss-appl.xml configuration:

<jboss-app>
   <module>
      <har>sample.har</har>
   </module>
</jboss-app>

 

If you want to provide a .sar archive then you would need:

<jboss-app>
  <module>
    <service>sample.sar</service>
  </module>
</jboss-app>

You can also add a web application module configuration, which will override the default EAR configuration:

<module>
    <web>
       <web-uri>myapp.war</web-uri>
       <context-root>/myapp</context-root>
    </web>
</module>

Related articles available on mastertheboss.com

How to configure JBoss to disable hot deployment ?

On JBoss AS 7 and WildFly the default rule is that archived appli

How do I make sure my MBean is deployed after my EJB ?

  If your MBean is dependant on another resource, supposing cont

How do I change the default lib directory in an ear file?

  Supposing you have an Enterprise application which has been pa

How to let JBoss deploy an application after other apps?

  If you are running JBoss AS 7 or WildFly check the following t

How to deploy an application temporarly with JBoss ?

One way to do it, is using the jboss.system:service=MainDeployer

JBoss deployment directory configuration

In this tutorial we are going to show how to provide an alternati

Follow us on Twitter