How to deploy a HAR file inside an EAR ?

Hibernate archives can be deployed as top level packages or can be deployed as a component of an EAR file. Since Hibernate archives are not a standard J2EE deployment type, we need to declare them in the jboss-app.xml file of an EAR file to use them that context.

This is done with a module/har element as shown in the following example.

<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
 <jboss-app>
  <module>
   <har>sample.har</har>
  </module>
 </jboss-app>

With this, a Hibernate archive can be deployed along side a WAR or EAR file in any EAR file.