5.9. Hibernate Search as Red Hat JBoss EAP Module

In JBoss EAP 6, class loading is based on modules that define explicit dependencies on other modules. Modules allow sharing of common artifacts across applications thus resulting in smaller and quicker deployments.
Hibernate Search modules are distributed as part of the JBoss Web Framework Kit Maven repository. The repository is distributed with the release in the jboss-wfk-2.7.0-maven-repository.zip file, and can be downloaded from Red Hat Customer Portal.
Unpack the Maven repository ZIP archive. Inside the unpacked directory, there is another ZIP archive containing the actual modules. It is located at the following path:
org/hibernate/hibernate-search-modules/4.4.4.Final-redhat-wfk-1/hibernate-search-modules-4.4.4.Final-redhat-wfk-1-jbossas-74-dist.zip
Unpack the archive into the modules/ directory in the target JBoss Enterprise Application Platform. Modules for Hibernate Search, Apache Lucene, and some useful Solr libraries will be added. The Hibernate Search modules are:
  • org.hibernate.search.orm:main for users of Hibernate Search with Hibernate; this transitively includes Hibernate ORM.
  • org.hibernate.search.engine:main for projects depending on the internal indexing engine that do not require other dependencies to Hibernate.
Hibernate Search offers the following two methods for including dependencies in a project:
Using MANIFEST.MF file
Add the following entry to the MANIFEST.MF file in the project archive:
Dependencies: org.hibernate.search.orm services
Using jboss-deployment-structure.xml file
Add WEB-INF/jboss-deployment-structure.xml file in the project archive with the following content:
<jboss-deployment-structure>
      <deployment>
          <dependencies>
              <module name="org.hibernate.search.orm" services="export" />
          </dependencies>
      </deployment>
  </jboss-deployment-structure>