Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFLY-15838 + WFLY-15839 + WFLY-15840 + WFLY-15841 + WFLY-15842 Upgrade to Hibernate Search 6 (EE 9 + ORM 6) #15185

Merged
merged 18 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9676527
WFLY-15840 Upgrade to Avro 1.11.0
yrodiere Dec 10, 2021
0f10fe2
WFLY-15841 Add (private) module for com.carrotsearch.hppc
yrodiere Dec 8, 2021
d1fd722
WFLY-15842 Add (private) module for the Elasticsearch low-level REST …
yrodiere Dec 15, 2021
9034d85
WFLY-15838 Move our single Hibernate Search test to a dedicated package
yrodiere Dec 6, 2021
6091884
WFLY-15838 Disable Hibernate Search 5 tests in EE9 (WF Preview) ITs
yrodiere May 6, 2022
9494861
WFLY-15838 Disable Hibernate Search tests in security manager ITs
yrodiere May 11, 2022
83e3078
WFLY-15838 Copy relevant tests from Hibernate Search integration test…
yrodiere Dec 6, 2021
e3e17ef
WFLY-15838 Test more advanced Search use cases involving analysis con…
yrodiere May 6, 2022
b73130a
WFLY-15838 Prune Hibernate Search 5.x from EE9 (WF Preview)
yrodiere Feb 2, 2022
20bed8a
WFLY-15838 Copy Hibernate Search tests to preview/
yrodiere May 6, 2022
f41d11b
WFLY-15839 WFLY-15838 Upgrade to Lucene 8.11, Hibernate Search 6.1 fo…
yrodiere Dec 8, 2021
0374d94
WFLY-15838 Test the ability for applications to use native Lucene cla…
yrodiere Dec 10, 2021
546275c
WFLY-15838 Test that applications can use hibernate-search-mapper-orm…
yrodiere Dec 10, 2021
d1dbf15
WFLY-15838 Test that applications can use hibernate-search-v5migratio…
yrodiere Dec 13, 2021
97c6551
WFLY-15838 Add a module for org.hibernate.search:hibernate-search-bac…
yrodiere Dec 15, 2021
c2a44f7
WFLY-15838 Move tests specifically about the Lucene backend to a dedi…
yrodiere Dec 15, 2021
4d61bbc
WFLY-15838 Test Hibernate Search with Elasticsearch
yrodiere Dec 15, 2021
3845b01
WFLY-15838 Fix CDI bean detection for Hibernate tests in Jakarta EE p…
yrodiere Mar 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,24 @@ Persistence.xml to use the above custom settings:
[[using-hibernate-search]]
== Using Hibernate Search

WildFly includes Hibernate Search. If you want to use the bundled version of Hibernate Search, which requires to use the default Hibernate ORM persistence provider, this will be automatically enabled. Having this enabled means that, provided your application includes any entity which is annotated with *org.hibernate.search.annotations.Indexed*, the module *org.hibernate.search.orm:main* will be made available to your deployment; this will also include the required version of Apache Lucene.
WildFly includes Hibernate Search.
If you want to use the bundled version of Hibernate Search, which requires to use the default Hibernate ORM persistence provider:

If you do not want this module to be exposed to your deployment, set the persistence property *wildfly.jpa.hibernate.search.module* to either *none* to not automatically inject any Hibernate Search module, or to any other module identifier to inject a different module. For example you could set *wildfly.jpa.hibernate.search.module=org.hibernate.search.orm:5.11.0.Alpha1* to use the experimental version 5.11.0.Alpha1 instead of the provided module; in this case you'll have to download and add the custom modules to the application server as other versions are not included. When setting *wildfly.jpa.hibernate.search.module=none* you might also opt to include Hibernate Search and its dependencies within your application but we highly recommend the modules approach.
* Ensure at least one entity in your application is annotated with *org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed*,
so that WildFly will make the module *org.hibernate.search.mapper.orm:main* available to your deployment.
* Ensure you set the configuration property `hibernate.search.backend.type` to `lucene`,
so that WildFly will make the module *org.hibernate.search.backend.lucene:main* available to your deployment.
* Alternatively, add dependencies to those modules explicitly,
for example using a <<dependencies-manifest-entries,manifest entry>>.
Do not forget to append the `services` keyword, otherwise Hibernate Search may not detect these modules.
+
For example:
[source]
----
Dependencies: org.hibernate.search.mapper.orm services,org.hibernate.search.backend.lucene services
----

If you do not want Hibernate Search to be exposed to your deployment, set the persistence property *wildfly.jpa.hibernate.search.module* to either *none* to not automatically inject any Hibernate Search module, or to any other module identifier to inject a different module. For example you could set *wildfly.jpa.hibernate.search.module=org.hibernate.search.mapper.orm:6.1.0.Beta1* to use the experimental version 6.1.0.Beta1 instead of the provided module; in this case you'll have to download and add the custom modules to the application server as other versions are not included. When setting *wildfly.jpa.hibernate.search.module=none* you might also opt to include Hibernate Search and its dependencies within your application but we highly recommend the modules approach.

[[packaging-the-hibernate-jpa-persistence-provider-with-your-application]]
== Packaging the Hibernate JPA persistence provider with your application
Expand Down Expand Up @@ -727,7 +742,7 @@ across all application deployments on the AS instance).

|hibernate.auto_quote_keyword=false | 

|hibernate.implicit_naming_strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
|hibernate.implicit_naming_strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl |

|hibernate.model.generator_name_as_sequence_name=true |

Expand All @@ -747,8 +762,6 @@ across all application deployments on the AS instance).

|hibernate.jpa.compliance.global_id_generators=true |

|hibernate.search.index_uninverting_allowed=true |
|=======================================================================

if *hibernate.id.new_generator_mappings* is *true*:
Expand Down
72 changes: 72 additions & 0 deletions ee-9/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,78 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-common</artifactId>
<version>${version.org.hibernate.search}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-engine</artifactId>
<version>${version.org.hibernate.search}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-lucene</artifactId>
<version>${version.org.hibernate.search}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-elasticsearch</artifactId>
<version>${version.org.hibernate.search}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-pojo-base</artifactId>
<version>${version.org.hibernate.search}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-orm-orm6</artifactId>
<version>${version.org.hibernate.search}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2022, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<module xmlns="urn:jboss:module:1.9" name="org.apache.lucene">

<properties>
<!-- Native Lucene access won't be supported in JBoss EAP;
only indirect usage through other modules (Hibernate Search, ...) may be. -->
<property name="jboss.api" value="private"/>
</properties>

<resources>
<artifact name="${org.apache.lucene:lucene-analyzers-common}"/>
<artifact name="${org.apache.lucene:lucene-core}"/>
<artifact name="${org.apache.lucene:lucene-facet}"/>
<artifact name="${org.apache.lucene:lucene-queries}"/>
<artifact name="${org.apache.lucene:lucene-queryparser}"/>
<artifact name="${org.apache.lucene:lucene-join}"/>
</resources>

<dependencies>
<module name="java.logging"/>
<!--WFLY-14219 Remove deprecated <module name="javax.api"/> -->
<module name="com.carrotsearch.hppc" />
<module name="java.xml"/>
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2022, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<!-- Hibernate Search Elasticsearch backend: provides the ability to index into a remote Elasticsearch index -->
<module xmlns="urn:jboss:module:1.9" name="org.hibernate.search.backend.elasticsearch">

<resources>
<artifact name="${org.hibernate.search:hibernate-search-backend-elasticsearch}"/>
</resources>

<dependencies>
<module name="org.jboss.logging"/>
<module name="org.hibernate.search.engine" export="true"/>
<!-- This is not exported on purpose: users wanting to use the REST client or Gson directly
need to explicitly opt in by adding a dependency to that module -->
<module name="org.elasticsearch.client.rest-client" />
<module name="com.google.code.gson" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2022, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<!-- Hibernate Search Lucene backend: provides the ability to index into a Lucene index on the local filesystem -->
<module xmlns="urn:jboss:module:1.9" name="org.hibernate.search.backend.lucene">

<resources>
<artifact name="${org.hibernate.search:hibernate-search-backend-lucene}"/>
</resources>

<dependencies>
<module name="org.jboss.logging"/>
<module name="org.hibernate.search.engine" export="true" />
<!-- This is not exported on purpose: users wanting to use Lucene directly need to explicitly opt in
by adding a dependency to that module -->
<module name="org.apache.lucene" />
<module name="com.carrotsearch.hppc" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2022, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<!-- Hibernate Search Engine: the main glue between backend (e.g. Lucene backend)
and mapper (e.g. Hibernate ORM mapper) -->
<module xmlns="urn:jboss:module:1.9" name="org.hibernate.search.engine">

<resources>
<artifact name="${org.hibernate.search:hibernate-search-util-common}"/>
<artifact name="${org.hibernate.search:hibernate-search-engine}"/>
</resources>

<dependencies>
<module name="org.jboss.logging"/>
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2022, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<!-- Hibernate Search ORM Mapper: integrates org.hibernate.search.engine with
Hibernate ORM to provide Hibernate Search functionality to
JPA Applications -->
<module xmlns="urn:jboss:module:1.9" name="org.hibernate.search.mapper.orm">

<resources>
<artifact name="${org.hibernate.search:hibernate-search-mapper-orm-orm6}"/>
</resources>

<dependencies>
<module name="javax.persistence.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.transaction.api"/>
<module name="org.jboss.logging" />
<module name="org.hibernate.search.engine" export="true" />
<module name="org.hibernate.search.mapper.pojo-base" export="true" />
<module name="org.hibernate" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2022, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<!-- Hibernate Search Pojo-base Mapper: base code for mappers such as org.hibernate.search.mapper.orm -->
<module xmlns="urn:jboss:module:1.9" name="org.hibernate.search.mapper.pojo-base">

<resources>
<artifact name="${org.hibernate.search:hibernate-search-mapper-pojo-base}"/>
</resources>

<dependencies>
<module name="org.jboss.logging" />
<module name="java.sql" export="true" /> <!-- For java.sql.Date, etc. -->
<module name="org.hibernate.search.engine" export="true" />
<module name="org.hibernate.commons-annotations" export="true" />
</dependencies>
</module>