When standard APIs are involved, Hibernate Search targets Jakarta EE by default.
Hibernate Search includes legacy support for Java EE,
and it requires only one small change:
when declaring the dependencies of your project,
you must add -javaee
to some artifact identifiers.
For example, an application using Hibernate ORM and the Elasticsearch backend will need to update its dependencies as follows:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core-javaee</artifactId> <!--(1)-->
<version>{hibernateVersion}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-orm-javaee</artifactId> <!--(2)-->
<version>{hibernateSearchVersion}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-elasticsearch</artifactId> <!--(3)-->
<version>{hibernateSearchVersion}</version>
</dependency>
-
Replaces
hibernate-core
. -
Replaces
hibernate-search-mapper-orm
. -
No replacement necessary: this artifact does not rely on Jakarta EE.
All artifacts relying directly or indirectly on Jakarta EE must be replaced with their Java EE counterpart. This includes in particular:
-
hibernate-search-mapper-orm
⇒hibernate-search-mapper-orm-javaee
-
hibernate-search-mapper-orm-batch-jsr352-core
⇒hibernate-search-mapper-orm-batch-jsr352-core-javaee
-
…
Artifacts that do not rely on Jakarta EE at all, on the other hand, do not have a Java EE counterpart and must not be replaced. These artifacts should be excluded from your replacements in particular:
-
hibernate-search-engine
-
hibernate-search-backend-lucene
-
hibernate-search-backend-elasticsearch
-
hibernate-search-backend-elasticsearch-aws
-
…
Hibernate Search includes experimental support for Hibernate ORM 6,
and it requires only one small change:
when declaring the dependencies of your project,
you must add -orm6
to some artifact identifiers.
Warning
|
The experimental support for Hibernate ORM 6 in Hibernate Search {hibernateSearchVersion} targets Hibernate ORM version {hibernateOrm6Version}. Newer versions of Hibernate ORM 6 may introduce breaking changes, in which case they will no longer be compatible with the experimental support for Hibernate ORM 6 in Hibernate Search {hibernateSearchVersion}, until Hibernate Search catches up in its next release. |
For example, an application using Hibernate ORM 6 and the Elasticsearch backend will need to update its dependencies as follows:
<dependency>
<groupId>org.hibernate.orm</groupId> <!--(1)-->
<artifactId>hibernate-core</artifactId>
<version>{hibernateOrm6Version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-orm-orm6</artifactId> <!--(2)-->
<version>{hibernateSearchVersion}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-elasticsearch</artifactId> <!--(3)-->
<version>{hibernateSearchVersion}</version>
</dependency>
-
Replaces
org.hibernate:hibernate-core
; notice how the groupId changed in Hibernate ORM 6. -
Replaces
hibernate-search-mapper-orm
. -
No replacement necessary: this artifact does not rely on Java EE or Hibernate ORM.
All artifacts relying directly or indirectly on Java EE or Hibernate ORM must be replaced with their ORM 6 counterpart. This includes in particular:
-
hibernate-search-mapper-orm
⇒hibernate-search-mapper-orm-orm6
-
hibernate-search-mapper-orm-batch-jsr352-core
⇒hibernate-search-mapper-orm-batch-jsr352-core-orm6
-
…
Artifacts that do not rely on Java EE or Hibernate ORM at all, on the other hand, do not have an ORM 6 counterpart and must not be replaced. These artifacts should be excluded from your replacements in particular:
-
hibernate-search-engine
-
hibernate-search-backend-lucene
-
hibernate-search-backend-elasticsearch
-
hibernate-search-backend-elasticsearch-aws
-
…