Skip to content

Commit 852131e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature-spring-projects#2726
# Conflicts: # src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java
2 parents 0a17e2a + 9f42ec9 commit 852131e

File tree

336 files changed

+5816
-27288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+5816
-27288
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ target
2626
/zap.env
2727
/localdocker.env
2828
.localdocker-env
29+
30+
build/
31+
node_modules
32+
node
33+
package.json
34+
package-lock.json

.mvn/wrapper/maven-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#Thu Apr 06 16:16:37 CEST 2023
1+
#Wed Oct 04 16:58:13 PDT 2023
22
wrapperUrl=https\://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3-
distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
3+
distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip

CONTRIBUTING.adoc

-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ Do not submit a Pull Request before having created an issue and having discussed
88
== Running the test locally
99

1010
In order to run the tests locally with `./mvnw test` you need to have docker running because Spring Data Elasticsearch uses https://www.testcontainers.org/[Testcontainers] to start a local running Elasticsearch instance.
11-
12-
== Class names of the test classes
13-
14-
Test classes that do depend on the client have either `ERHLC` (when using the deprecated Elasticsearch `RestHighLevelClient`) or `ELC` (the new `ElasticsearchClient`) in their name.

Jenkinsfile

-4
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,6 @@ pipeline {
111111
post {
112112
changed {
113113
script {
114-
slackSend(
115-
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
116-
channel: '#spring-data-dev',
117-
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}")
118114
emailext(
119115
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
120116
mimeType: 'text/html',

README.adoc

+10-53
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,20 @@ image:https://spring.io/badges/spring-data-elasticsearch/ga.svg[Spring Data Elas
55
The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.
66

77
The Spring Data Elasticsearch project provides integration with the https://www.elastic.co/[Elasticsearch] search engine.
8-
Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with a Elasticsearch Documents and easily writing a Repository style data access layer.
8+
Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with Elasticsearch Documents and easily writing a Repository style data access layer.
99

1010
This project is lead and maintained by the community.
1111

1212
== Features
1313

14-
* Spring configuration support using Java based `@Configuration` classes or an XML namespace for a ES clients instances.
14+
* Spring configuration support using Java based `@Configuration` classes or an XML namespace for an ES client instances.
1515
* `ElasticsearchOperations` class and implementations that increases productivity performing common ES operations.
1616
Includes integrated object mapping between documents and POJOs.
1717
* Feature Rich Object Mapping integrated with Spring’s Conversion Service
1818
* Annotation based mapping metadata
1919
* Automatic implementation of `Repository` interfaces including support for custom search methods.
2020
* CDI support for repositories
2121

22-
== About Elasticsearch versions and clients
23-
24-
=== Elasticsearch 7.17 client libraries
25-
26-
At the end of 2021 Elasticsearch with version 7.17 released the new version of their Java client and deprecated the `RestHighLevelCLient` which was the default way to access Elasticsearch up to then.
27-
28-
Spring Data Elasticsearch will in version 4.4 offer the possibility to optionally use the new client as an alternative to the existing setup using the `RestHighLevelCLient`.
29-
The default client that is used still is the `RestHighLevelCLient`, first because the integration of the new client is not yet complete, the new client still has features missing and bugs which will hopefully be resolved soon.
30-
Second, and more important, the new Elasticsearch client forces users to switch from using `javax.json.spi.JsonProvider` to `jakarta.json.spi.JsonProvider`.
31-
Spring Data Elasticsearch cannot enforce this switch; Spring Boot will switch to `jakarta` with version 3 and then it's safe for Spring Data Elasticsearch to switch to the new client.
32-
33-
So for version 4.4 Spring Data Elasticsearch will keep using the `RestHighLevelCLient` in version 7.17.x (as long as this will be available).
34-
35-
=== Elasticsearch 8 client libraries
36-
37-
In Elasticsearch 8, the `RestHighLevelCLient` has been removed.
38-
This means that a switch to this client version can only be done with the next major upgrade which will be Spring Data Elasticsearch 5, based on Spring Data 3, used by Spring Boot 3, based on Spring 6 and Java 17.
39-
40-
=== Elasticsearch 8 cluster
41-
42-
It should be possible to use the Elasticsearch 7 client to access a cluster running version 8 by setting the appropriate compatibility headers (see the documentation at https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration). but I encountered and heard of cases where the response from the server is not parseable by the client although the headers are set, so use with care.
43-
4422
== Code of Conduct
4523

4624
This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct].
@@ -86,25 +64,7 @@ public class MyService {
8664

8765
=== Using the RestClient
8866

89-
Provide a configuration like this:
90-
91-
[source,java]
92-
----
93-
@Configuration
94-
public class RestClientConfig extends AbstractElasticsearchConfiguration {
95-
96-
@Override
97-
@Bean
98-
public RestHighLevelClient elasticsearchClient() {
99-
100-
final ClientConfiguration clientConfiguration = ClientConfiguration.builder()
101-
.connectedTo("localhost:9200")
102-
.build();
103-
104-
return RestClients.create(clientConfiguration).rest();
105-
}
106-
}
107-
----
67+
Please check the [official documentation](https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration).
10868

10969
=== Maven configuration
11070

@@ -119,9 +79,6 @@ Add the Maven dependency:
11979
</dependency>
12080
----
12181

122-
// NOTE: since Github does not support include directives, the content of
123-
// the src/main/asciidoc/reference/preface.adoc file is duplicated here
124-
// Always change both files!
12582
**Compatibility Matrix**
12683

12784
The compatibility between Spring Data Elasticsearch, Elasticsearch client drivers and Spring Boot versions can be found in the https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#preface.versions[reference documentation].
@@ -137,9 +94,9 @@ To use the Release candidate versions of the upcoming major version, use our Mav
13794
</dependency>
13895
13996
<repository>
140-
<id>spring-libs-snapshot</id>
97+
<id>spring-snapshot</id>
14198
<name>Spring Snapshot Repository</name>
142-
<url>https://repo.spring.io/libs-milestone</url>
99+
<url>https://repo.spring.io/milestone</url>
143100
</repository>
144101
----
145102

@@ -154,9 +111,9 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
154111
</dependency>
155112
156113
<repository>
157-
<id>spring-libs-snapshot</id>
114+
<id>spring-snapshot</id>
158115
<name>Spring Snapshot Repository</name>
159-
<url>https://repo.spring.io/libs-snapshot</url>
116+
<url>https://repo.spring.io/snapshot</url>
160117
</repository>
161118
----
162119

@@ -180,7 +137,7 @@ If you want to raise an issue, please follow the recommendations below:
180137

181138
* Before you log a bug, please search the
182139
https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] to see if someone has already reported the problem.
183-
* If the issue doesnt already exist, https://github.com/spring-projects/spring-data-elasticsearch/issues/new[create a new issue].
140+
* If the issue doesn't already exist, https://github.com/spring-projects/spring-data-elasticsearch/issues/new[create a new issue].
184141
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data Elasticsearch that you are using and JVM version.
185142
* If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text.
186143
* If possible try to create a test-case or project that replicates the issue.
@@ -211,10 +168,10 @@ Building the documentation builds also the project without running tests.
211168

212169
[source,bash]
213170
----
214-
$ ./mvnw clean install -Pdistribute
171+
$ ./mvnw clean install -Pantora
215172
----
216173

217-
The generated documentation is available from `target/site/reference/html/index.html`.
174+
The generated documentation is available from `target/antora/site/index.html`.
218175

219176
== Examples
220177

TESTING.adoc

-21
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,3 @@ is run. There must be _docker_ running, as the integration tests use docker to s
1818

1919
Integration tests are tests that have the Junit5 Tag `@Tag("integration-test")` on the test class. Normally this should not be set explicitly, but the annotation `@SpringIntegrationTest` should be used. This not only marks the test as integration test, but integrates an automatic setup of an Elasticsearch Testcontainer and integrate this with Spring, so
2020
that the required Beans can be automatically injected. Check _src/test/java/org/springframework/data/elasticsearch/JUnit5SampleRestClientBasedTests.java_ as a reference setup
21-
22-
== Mutation testing
23-
24-
The pom includes a plugin dependency to run mutation tests using [pitest](https://pitest.org/). These tests must be explicitly configured and run, they are not included in the normal build steps. Before pitest can run, a normal `./mvnw test` must be executed. The configuration excludes integration tests, only unit tests are considered.
25-
26-
27-
pitest can be run directly from the commandline
28-
----
29-
./mvnw org.pitest:pitest-maven:mutationCoverage
30-
----
31-
This will output an html report to _target/pit-reports/YYYYMMDDHHMI_.
32-
33-
To speed-up repeated analysis of the same codebase set the withHistory parameter to true.
34-
----
35-
./mvnw -DwithHistory org.pitest:pitest-maven:mutationCoverage
36-
----
37-
38-
The classes to test are defined either in the pom.xml or can be set on the commandline:
39-
----
40-
./mvnw -DwithHistory org.pitest:pitest-maven:mutationCoverage -DtargetClasses="org.springframework.data.elasticsearch.support.*"
41-
----

ci/pipeline.properties

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
# Java versions
2-
java.main.tag=17.0.6_10-jdk-focal
3-
java.next.tag=20-jdk-jammy
2+
java.main.tag=17.0.8_7-jdk-focal
3+
java.next.tag=21-jdk-bullseye
44

55
# Docker container images - standard
66
docker.java.main.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.main.tag}
7-
docker.java.next.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.next.tag}
7+
docker.java.next.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/openjdk:${java.next.tag}
88

99
# Supported versions of MongoDB
10-
docker.mongodb.4.4.version=4.4.18
11-
docker.mongodb.5.0.version=5.0.14
12-
docker.mongodb.6.0.version=6.0.4
10+
docker.mongodb.4.4.version=4.4.25
11+
docker.mongodb.5.0.version=5.0.21
12+
docker.mongodb.6.0.version=6.0.10
13+
docker.mongodb.7.0.version=7.0.2
1314

1415
# Supported versions of Redis
15-
docker.redis.6.version=6.2.10
16+
docker.redis.6.version=6.2.13
1617

1718
# Supported versions of Cassandra
18-
docker.cassandra.3.version=3.11.14
19+
docker.cassandra.3.version=3.11.16
1920

2021
# Docker environment settings
2122
docker.java.inside.basic=-v $HOME:/tmp/jenkins-home

0 commit comments

Comments
 (0)