Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 737650ac54 | |||
| b3f21736b6 | |||
| fbed601efa | |||
| 5f2d71ef32 | |||
| 2904427e9b | |||
| 167f2246d3 | |||
| f09ce87f0e | |||
| 1d5c78a06a | |||
| 5a2dcd3b01 | |||
| 74b05d21b5 | |||
| 1895219322 |
Vendored
+4
-2
@@ -99,15 +99,17 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
|
||||
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
|
||||
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
|
||||
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
|
||||
"./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root " +
|
||||
"./mvnw -s settings.xml -Pci,artifactory " +
|
||||
"-Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root " +
|
||||
"-Dartifactory.server=${p['artifactory.url']} " +
|
||||
"-Dartifactory.username=${ARTIFACTORY_USR} " +
|
||||
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
|
||||
"-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " +
|
||||
"-Dartifactory.build-name=spring-data-elasticsearch " +
|
||||
"-Dartifactory.build-number=spring-data-elasticsearch-${BRANCH_NAME}-build-${BUILD_NUMBER} " +
|
||||
"-Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch " +
|
||||
"-Dmaven.test.skip=true clean deploy -U -B"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ set -euo pipefail
|
||||
export JENKINS_USER=${JENKINS_USER_NAME}
|
||||
|
||||
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
|
||||
./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch
|
||||
./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root
|
||||
|
||||
+1
-2
@@ -3,9 +3,8 @@
|
||||
set -euo pipefail
|
||||
|
||||
mkdir -p /tmp/jenkins-home/.m2/spring-data-elasticsearch
|
||||
chown -R 1001:1001 .
|
||||
export JENKINS_USER=${JENKINS_USER_NAME}
|
||||
|
||||
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
|
||||
./mvnw -s settings.xml \
|
||||
-P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch
|
||||
-P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-elasticsearch</artifactId>
|
||||
<version>5.2.9</version>
|
||||
<version>5.2.11</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.data.build</groupId>
|
||||
<artifactId>spring-data-parent</artifactId>
|
||||
<version>3.2.9</version>
|
||||
<version>3.2.11</version>
|
||||
</parent>
|
||||
|
||||
<name>Spring Data Elasticsearch</name>
|
||||
@@ -18,12 +18,11 @@
|
||||
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
|
||||
|
||||
<properties>
|
||||
<springdata.commons>3.2.9</springdata.commons>
|
||||
<springdata.commons>3.2.11</springdata.commons>
|
||||
|
||||
<!-- version of the ElasticsearchClient -->
|
||||
<elasticsearch-java>8.11.4</elasticsearch-java>
|
||||
|
||||
<blockhound-junit>1.0.8.RELEASE</blockhound-junit>
|
||||
<hoverfly>0.14.4</hoverfly>
|
||||
<log4j>2.18.0</log4j>
|
||||
<jsonassert>1.5.1</jsonassert>
|
||||
@@ -248,13 +247,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.projectreactor.tools</groupId>
|
||||
<artifactId>blockhound-junit-platform</artifactId>
|
||||
<version>${blockhound-junit}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.skyscreamer</groupId>
|
||||
<artifactId>jsonassert</artifactId>
|
||||
@@ -436,25 +428,6 @@
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>jdk13+</id>
|
||||
<!-- on jDK13+, Blockhound needs this JVM flag set -->
|
||||
<activation>
|
||||
<jdk>[13,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<argLine>-XX:+AllowRedefinitionToAddDeleteMethods</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>antora-process-resources</id>
|
||||
<build>
|
||||
|
||||
@@ -334,8 +334,10 @@ public class MappingBuilder {
|
||||
: nestedPropertyPrefix + '.' + property.getFieldName();
|
||||
|
||||
Field fieldAnnotation = property.findAnnotation(Field.class);
|
||||
MultiField multiFieldAnnotation = property.findAnnotation(MultiField.class);
|
||||
|
||||
if (fieldAnnotation != null && fieldAnnotation.excludeFromSource()) {
|
||||
if ((fieldAnnotation != null && fieldAnnotation.excludeFromSource()) ||
|
||||
multiFieldAnnotation != null && multiFieldAnnotation.mainField().excludeFromSource()) {
|
||||
excludeFromSource.add(nestedPropertyPath);
|
||||
}
|
||||
|
||||
@@ -366,8 +368,6 @@ public class MappingBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
MultiField multiField = property.findAnnotation(MultiField.class);
|
||||
|
||||
if (isCompletionProperty) {
|
||||
CompletionField completionField = property.findAnnotation(CompletionField.class);
|
||||
applyCompletionFieldMapping(propertiesNode, property, completionField);
|
||||
@@ -375,8 +375,8 @@ public class MappingBuilder {
|
||||
|
||||
if (isRootObject && fieldAnnotation != null && property.isIdProperty()) {
|
||||
applyDefaultIdFieldMapping(propertiesNode, property);
|
||||
} else if (multiField != null) {
|
||||
addMultiFieldMapping(propertiesNode, property, multiField, isNestedOrObjectProperty, dynamicMapping);
|
||||
} else if (multiFieldAnnotation != null) {
|
||||
addMultiFieldMapping(propertiesNode, property, multiFieldAnnotation, isNestedOrObjectProperty, dynamicMapping);
|
||||
} else if (fieldAnnotation != null) {
|
||||
addSingleFieldMapping(propertiesNode, property, fieldAnnotation, isNestedOrObjectProperty, dynamicMapping);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Spring Data Elasticsearch 5.2.9 (2023.1.9)
|
||||
Spring Data Elasticsearch 5.2.11 (2023.1.11)
|
||||
Copyright (c) [2013-2022] Pivotal Software, Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
@@ -26,4 +26,6 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright 2021-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.blockhound;
|
||||
|
||||
import reactor.blockhound.BlockHound;
|
||||
import reactor.blockhound.BlockingOperationError;
|
||||
import reactor.blockhound.integration.BlockHoundIntegration;
|
||||
|
||||
/**
|
||||
* @author Peter-Josef Meisch
|
||||
*/
|
||||
public class BlockHoundIntegrationCustomizer implements BlockHoundIntegration {
|
||||
|
||||
@Override
|
||||
public void applyTo(BlockHound.Builder builder) {
|
||||
// Elasticsearch classes reading from the classpath on initialization, needed for parsing Elasticsearch responses
|
||||
builder //
|
||||
.allowBlockingCallsInside("org.elasticsearch.Build", "<clinit>") //
|
||||
.allowBlockingCallsInside("org.elasticsearch.common.xcontent.XContentBuilder", "<clinit>") // pre 7.16
|
||||
.allowBlockingCallsInside("org.elasticsearch.common.XContentBuilder", "<clinit>") // from 7.16 on
|
||||
.allowBlockingCallsInside("org.elasticsearch.xcontent.json.JsonXContent", "contentBuilder") // from 7.16 on
|
||||
.allowBlockingCallsInside("jakarta.json.spi.JsonProvider", "provider") //
|
||||
;
|
||||
builder.blockingMethodCallback(it -> {
|
||||
new Error(it.toString()).printStackTrace();
|
||||
throw new BlockingOperationError(it);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright 2021-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.blockhound;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import reactor.blockhound.BlockingOperationError;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author Peter-Josef Meisch
|
||||
*/
|
||||
public class BlockHoundTests {
|
||||
|
||||
@Test // #1822
|
||||
@DisplayName("should fail if BlockHound is not installed")
|
||||
void shouldFailIfBlockHoundIsNotInstalled() {
|
||||
|
||||
assertThatThrownBy(() -> {
|
||||
Mono.delay(Duration.ofMillis(1)).doOnNext(it -> {
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).block(); // should throw an exception about Thread.sleep
|
||||
}).hasCauseInstanceOf(BlockingOperationError.class);
|
||||
}
|
||||
}
|
||||
+47
-32
@@ -1095,38 +1095,49 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
|
||||
String expected = """
|
||||
{
|
||||
"properties": {
|
||||
"_class": {
|
||||
"type": "keyword",
|
||||
"index": false,
|
||||
"doc_values": false
|
||||
},
|
||||
"excluded-date": {
|
||||
"type": "date",
|
||||
"format": "date"
|
||||
},
|
||||
"nestedEntity": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"_class": {
|
||||
"type": "keyword",
|
||||
"index": false,
|
||||
"doc_values": false
|
||||
},
|
||||
"excluded-text": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"_source": {
|
||||
"excludes": [
|
||||
"excluded-date",
|
||||
"nestedEntity.excluded-text"
|
||||
]
|
||||
}
|
||||
}
|
||||
"""; //
|
||||
"properties": {
|
||||
"_class": {
|
||||
"type": "keyword",
|
||||
"index": false,
|
||||
"doc_values": false
|
||||
},
|
||||
"excluded-date": {
|
||||
"type": "date",
|
||||
"format": "date"
|
||||
},
|
||||
"nestedEntity": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"_class": {
|
||||
"type": "keyword",
|
||||
"index": false,
|
||||
"doc_values": false
|
||||
},
|
||||
"excluded-text": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"excluded-multifield": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"_source": {
|
||||
"excludes": [
|
||||
"excluded-date",
|
||||
"nestedEntity.excluded-text",
|
||||
"excluded-multifield"
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
"""; //
|
||||
|
||||
String mapping = getMappingBuilder().buildPropertyMapping(ExcludedFieldEntity.class);
|
||||
|
||||
@@ -2367,6 +2378,10 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
excludeFromSource = true) private LocalDate excludedDate;
|
||||
@Nullable
|
||||
@Field(type = Nested) private NestedExcludedFieldEntity nestedEntity;
|
||||
@Nullable
|
||||
@MultiField(mainField = @Field(name = "excluded-multifield", type = Text, excludeFromSource = true), otherFields = {
|
||||
@InnerField(suffix = "keyword", type = Keyword)
|
||||
}) private String excludedMultifield;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
org.springframework.data.elasticsearch.blockhound.BlockHoundIntegrationCustomizer
|
||||
Reference in New Issue
Block a user