Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ and transform it to use Hibernate ORM 6 instead of Hibernate ORM 5.x.

### Basic build

You will need JDK 11 exactly;
You will need JDK 17 exactly;
newer JDKs will require you to [pass additional properties](#other-jdks)
in order for tests to run correctly.

Expand Down Expand Up @@ -198,16 +198,16 @@ To test Hibernate Search against JDK 8:
./mvnw clean install -Djava-version.test.release=8 -Djava-version.test.launcher.java_home=/path/to/jdk8
```

To test Hibernate Search against JDKs newer than 11:
To test Hibernate Search against JDKs other than 8 or the default 17:

```bash
./mvnw clean install -Djava-version.test.release=17 -Djava-version.test.compiler.java_home=/path/to/jdk17
./mvnw clean install -Djava-version.test.release=11 -Djava-version.test.compiler.java_home=/path/to/jdk11
```

Or more simply, if the newer JDK you want to test against is your default JDK:
Or more simply, if the newer JDK you want to test against is newer than 17 and is your default JDK:

```bash
./mvnw clean install -Djava-version.test.release=17
./mvnw clean install -Djava-version.test.release=18
```

### Elasticsearch
Expand Down
14 changes: 4 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ import org.hibernate.jenkins.pipeline.helpers.alternative.AlternativeMultiMap
* settingsId: ...
*/

@Field final String DEFAULT_JDK_TOOL = 'OpenJDK 11 Latest'
@Field final String DEFAULT_JDK_TOOL = 'OpenJDK 17 Latest'
@Field final String MAVEN_TOOL = 'Apache Maven 3.8'

// Default node pattern, to be used for resource-intensive stages.
Expand All @@ -171,20 +171,14 @@ stage('Configure') {
jdk: [
// This should not include every JDK; in particular let's not care too much about EOL'd JDKs like version 9
// See http://www.oracle.com/technetwork/java/javase/eol-135779.html
// We only run the tests with JDK8, but we compile them with JDK11 (with --release 8).
// We only run the tests with JDK8, but we compile them with JDK17 (with --release 8).
new JdkBuildEnvironment(version: '8', testLauncherTool: 'OpenJDK 8 Latest',
condition: TestCondition.AFTER_MERGE),
new JdkBuildEnvironment(version: '11', testCompilerTool: 'OpenJDK 11 Latest',
condition: TestCondition.AFTER_MERGE),
new JdkBuildEnvironment(version: '17', testCompilerTool: 'OpenJDK 17 Latest',
condition: TestCondition.BEFORE_MERGE,
isDefault: true),
new JdkBuildEnvironment(version: '14', testCompilerTool: 'OpenJDK 14 Latest',
condition: TestCondition.ON_DEMAND),
new JdkBuildEnvironment(version: '15', testCompilerTool: 'OpenJDK 15 Latest',
condition: TestCondition.ON_DEMAND),
new JdkBuildEnvironment(version: '16', testCompilerTool: 'OpenJDK 16 Latest',
condition: TestCondition.ON_DEMAND),
new JdkBuildEnvironment(version: '17', testCompilerTool: 'OpenJDK 17 Latest',
condition: TestCondition.AFTER_MERGE),
new JdkBuildEnvironment(version: '18', testCompilerTool: 'OpenJDK 18 Latest',
condition: TestCondition.AFTER_MERGE),
new JdkBuildEnvironment(version: '19', testCompilerTool: 'OpenJDK 19 Latest',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
/**
* This package contains everything related to the configuration of the Hibernate Search engine.
*
* <h3>Common expected types for property values</h3>
* <h2>Common expected types for property values</h2>
*
* Below are some commonly used property types across all Hibernate Search settings
* (engine, backends, mappers, ...).
*
* <h4 id="bean-reference">Bean reference</h4>
* <h2 id="bean-reference">Bean reference</h2>
*
* A reference to a bean of type {@code T} can be passed as either:
* <ul>
Expand All @@ -33,7 +33,7 @@
* representing the type of a CDI bean which happens to expose a public, no-arg constructor,
* then Hibernate Search will retrieve the bean through CDI, not by calling the constructor directly.
*
* <h4 id="bean-reference-multi">Multi-valued bean reference</h4>
* <h2 id="bean-reference-multi">Multi-valued bean reference</h2>
*
* A multi-valued reference to a bean of type {@code T} can be passed as either:
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@
* <p>
* Different types of clauses have different effects, see below.
*
* <h3 id="must">"must" clauses</h3>
* <h2 id="must">"must" clauses</h2>
* <p>
* "must" clauses are required to match: if they don't match, then the boolean predicate will not match.
* <p>
* Matching "must" clauses are taken into account during score computation.
*
* <h3 id="mustnot">"must not" clauses</h3>
* <h2 id="mustnot">"must not" clauses</h2>
* <p>
* "must not" clauses are required to not match: if they match, then the boolean predicate will not match.
* <p>
* "must not" clauses are ignored during score computation.
*
* <h3 id="filter">"filter" clauses</h3>
* <h2 id="filter">"filter" clauses</h2>
* <p>
* "filter" clauses are required to match: if they don't match, then the boolean predicate will not match.
* <p>
* "filter" clauses are ignored during score computation,
* and so are any clauses of boolean predicates contained in the filter clause (even "must" or "should" clauses).
*
* <h3 id="should">"should" clauses</h3>
* <h2 id="should">"should" clauses</h2>
* <p>
* "should" clauses may optionally match, and are required to match depending on the context.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public interface MatchIdPredicateMatchingStep<N extends MatchIdPredicateMatching
* Target the identifier with the given id.
* <p>
* If used multiple times, it will target any of the specified values.
* <p>
* @see #matchingAny(Collection)
* @param value the value of the id we want to match.
* @return The next step.
Expand All @@ -34,7 +33,6 @@ default N matching(Object value) {
* Target the identifier with the given id.
* <p>
* If used multiple times, it will target any of the specified values.
* <p>
* @see #matchingAny(Collection)
* @param value the value of the id we want to match.
* @param convert Controls how the {@code value} should be converted
Expand All @@ -46,7 +44,6 @@ default N matching(Object value) {

/**
* Target the identifiers matching any of the values in a collection.
* <p>
* @param values the collection of identifiers to match.
* @return The next step.
*/
Expand All @@ -56,7 +53,6 @@ default N matchingAny(Collection<?> values) {

/**
* Target the identifiers matching any of the values in a collection.
* <p>
* @param values the collection of identifiers to match.
* @param convert Controls how the {@code value} should be converted
* before Hibernate Search attempts to interpret it as an identifier value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* The step in a "minimum should match" constraint definition
* where a condition can be defined as necessary for the following requirements to be enforced.
*
* <h3 id="minimumshouldmatch">"minimumShouldMatch" constraints</h3>
* <h2 id="minimumshouldmatch">"minimumShouldMatch" constraints</h2>
* <p>
* "minimumShouldMatch" constraints define a minimum number of "should" clauses that have to match
* in order for the boolean predicate to match.
Expand All @@ -21,7 +21,7 @@
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">{@code minimum_should_match}</a>
* in Elasticsearch.
*
* <h4 id="minimumshouldmatch-minimum">Definition of the minimum</h4>
* <h3 id="minimumshouldmatch-minimum">Definition of the minimum</h3>
* <p>
* The minimum may be defined either directly as a positive number, or indirectly as a negative number
* or positive or negative percentage representing a ratio of the total number of "should" clauses in this boolean predicate.
Expand Down Expand Up @@ -54,7 +54,7 @@
* behavior is backend-specific (it may throw an exception, or produce unpredictable results,
* or fall back to some default behavior).
*
* <h4 id="minimumshouldmatch-conditionalconstraints">Conditional constraints</h4>
* <h3 id="minimumshouldmatch-conditionalconstraints">Conditional constraints</h3>
* <p>
* Multiple conditional constraints may be defined,
* only one of them being applied depending on the total number of "should" clauses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<artifactId>hibernate-search-integrationtest-java-modules</artifactId>
<packaging>jar</packaging>

<name>Hibernate Search ITs - JDK - Java modules</name>
<description>Hibernate Search integration tests for (JDK 11+) Java modules</description>
<name>Hibernate Search ITs - Java - Modules</name>
<description>Hibernate Search integration tests for Java 11+ modules</description>

<properties>
<test.elasticsearch.run.skip>${test.elasticsearch.connection.uris.defined}</test.elasticsearch.run.skip>
Expand All @@ -25,14 +25,7 @@
<failsafe.useModulePath>true</failsafe.useModulePath>

<surefire.jvm.args.module>
-Dhibernate.search.backend.uris=${test.elasticsearch.connection.uris}
-Dhibernate.search.backend.username=${test.elasticsearch.connection.username}
-Dhibernate.search.backend.password=${test.elasticsearch.connection.password}
-Dhibernate.search.backend.aws.signing.enabled=${test.elasticsearch.connection.aws.signing.enabled}
-Dhibernate.search.backend.aws.region=${test.elasticsearch.connection.aws.region}
-Dhibernate.search.backend.aws.credentials.type=${test.elasticsearch.connection.aws.credentials.type}
-Dhibernate.search.backend.aws.credentials.access_key_id=${test.elasticsearch.connection.aws.credentials.access_key_id}
-Dhibernate.search.backend.aws.credentials.secret_access_key=${test.elasticsearch.connection.aws.credentials.secret_access_key}
${test.elasticsearch.connection.jvm.args}
</surefire.jvm.args.module>
</properties>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module org.hibernate.search.integrationtest.java.module {
exports org.hibernate.search.integrationtest.java.module.service;
opens org.hibernate.search.integrationtest.java.module.entity to
exports org.hibernate.search.integrationtest.java.modules.service;
opens org.hibernate.search.integrationtest.java.modules.entity to
org.hibernate.orm.core,
/*
* TODO HSEARCH-4302 This part of the "opens" directive ideally should not be necessary.
* Hopefully we should be able to ask for a MethodHandles.Lookup instance from Hibernate ORM
* and take advantage of the fact the package is already open to Hibernate ORM?
*/
org.hibernate.search.mapper.orm;
opens org.hibernate.search.integrationtest.java.module.config to
opens org.hibernate.search.integrationtest.java.modules.config to
org.hibernate.search.engine; // For reflective instantiation of the analysis configurer

requires java.persistence;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.search.integrationtest.java.module.config;
package org.hibernate.search.integrationtest.java.modules.config;

import org.hibernate.search.backend.elasticsearch.analysis.ElasticsearchAnalysisConfigurer;
import org.hibernate.search.backend.elasticsearch.analysis.ElasticsearchAnalysisConfigurationContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.search.integrationtest.java.module.entity;
package org.hibernate.search.integrationtest.java.modules.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.search.integrationtest.java.module.config.MyElasticsearchAnalysisConfigurer;
import org.hibernate.search.integrationtest.java.modules.config.MyElasticsearchAnalysisConfigurer;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.search.integrationtest.java.module.service;
package org.hibernate.search.integrationtest.java.modules.service;

import java.util.List;

Expand All @@ -14,7 +14,7 @@
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.SessionFactoryBuilder;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.search.integrationtest.java.module.entity.Author;
import org.hibernate.search.integrationtest.java.modules.entity.Author;
import org.hibernate.search.mapper.orm.Search;
import org.hibernate.search.engine.search.query.SearchQuery;
import org.hibernate.search.mapper.orm.session.SearchSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ hibernate.max_fetch_depth = 5
## Connection info: see POM
hibernate.search.automatic_indexing.synchronization.strategy = sync
hibernate.search.backend.log.json_pretty_printing = true
hibernate.search.backend.analysis.configurer = org.hibernate.search.integrationtest.java.module.config.MyElasticsearchAnalysisConfigurer
hibernate.search.backend.analysis.configurer = org.hibernate.search.integrationtest.java.modules.config.MyElasticsearchAnalysisConfigurer
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.search.integrationtest.java.module.service;
package org.hibernate.search.integrationtest.java.modules.service;


import static org.junit.Assert.assertEquals;
Expand Down
29 changes: 2 additions & 27 deletions integrationtest/mapper/orm-batch-jsr352/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@
<test.elasticsearch.run.skip>${test.elasticsearch.connection.uris.defined}</test.elasticsearch.run.skip>

<surefire.jvm.args.module>
-Dhibernate.search.backend.uris=${test.elasticsearch.connection.uris}
-Dhibernate.search.backend.username=${test.elasticsearch.connection.username}
-Dhibernate.search.backend.password=${test.elasticsearch.connection.password}
-Dhibernate.search.backend.aws.signing.enabled=${test.elasticsearch.connection.aws.signing.enabled}
-Dhibernate.search.backend.aws.region=${test.elasticsearch.connection.aws.region}
-Dhibernate.search.backend.aws.credentials.type=${test.elasticsearch.connection.aws.credentials.type}
-Dhibernate.search.backend.aws.credentials.access_key_id=${test.elasticsearch.connection.aws.credentials.access_key_id}
-Dhibernate.search.backend.aws.credentials.secret_access_key=${test.elasticsearch.connection.aws.credentials.secret_access_key}
${test.elasticsearch.connection.jvm.args}
${test.weld.jvm.args}
</surefire.jvm.args.module>
</properties>

Expand Down Expand Up @@ -184,24 +178,5 @@
</plugins>
</build>

<profiles>
<profile>
<id>testWithJdk11+</id>
<activation>
<property>
<name>java-version.test.release</name>
<value>!8</value>
</property>
</activation>
<properties>
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them -->
<surefire.jvm.args.module>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</surefire.jvm.args.module>
</properties>
</profile>
</profiles>

</project>

25 changes: 6 additions & 19 deletions integrationtest/mapper/orm-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<name>Hibernate Search ITs - ORM - CDI</name>
<description>Hibernate Search integration tests for the Hibernate ORM integration with CDI</description>

<properties>
<surefire.jvm.args.module>
${test.weld.jvm.args}
</surefire.jvm.args.module>
</properties>

<dependencies>
<dependency>
<groupId>org.hibernate.search</groupId>
Expand Down Expand Up @@ -62,24 +68,5 @@
</plugins>
</build>

<profiles>
<profile>
<id>testWithJdk11+</id>
<activation>
<property>
<name>java-version.test.release</name>
<value>!8</value>
</property>
</activation>
<properties>
<!-- Weld performs illegal accesses to java.base to generate proxies, so we need to allow them -->
<surefire.jvm.args.module>
--add-opens java.base/java.security=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</surefire.jvm.args.module>
</properties>
</profile>
</profiles>

</project>

2 changes: 1 addition & 1 deletion integrationtest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</property>
</activation>
<modules>
<module>jdk/java-modules</module>
<module>java/modules</module>
</modules>
</profile>
</profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<packaging>jar</packaging>

<name>Hibernate Search ITs - JDK - Java modules - Jakarta EE</name>
<description>Hibernate Search integration tests for (JDK 11+) Java modules - Jakarta EE version</description>
<description>Hibernate Search integration tests for Java 11+ modules - Jakarta EE version</description>

<properties>
<transform.original.pathFromRoot>integrationtest/jdk/java-modules</transform.original.pathFromRoot>
<transform.original.pathFromRoot>integrationtest/java/modules</transform.original.pathFromRoot>

<test.elasticsearch.run.skip>${test.elasticsearch.connection.uris.defined}</test.elasticsearch.run.skip>
<test.database.run.skip>false</test.database.run.skip>
Expand All @@ -27,14 +27,7 @@
<failsafe.useModulePath>true</failsafe.useModulePath>

<surefire.jvm.args.module>
-Dhibernate.search.backend.uris=${test.elasticsearch.connection.uris}
-Dhibernate.search.backend.username=${test.elasticsearch.connection.username}
-Dhibernate.search.backend.password=${test.elasticsearch.connection.password}
-Dhibernate.search.backend.aws.signing.enabled=${test.elasticsearch.connection.aws.signing.enabled}
-Dhibernate.search.backend.aws.region=${test.elasticsearch.connection.aws.region}
-Dhibernate.search.backend.aws.credentials.type=${test.elasticsearch.connection.aws.credentials.type}
-Dhibernate.search.backend.aws.credentials.access_key_id=${test.elasticsearch.connection.aws.credentials.access_key_id}
-Dhibernate.search.backend.aws.credentials.secret_access_key=${test.elasticsearch.connection.aws.credentials.secret_access_key}
${test.elasticsearch.connection.jvm.args}
</surefire.jvm.args.module>
</properties>

Expand Down
Loading