From 6900670d87c53e433d10cd7c5d32cd40d5acad17 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Tue, 4 Mar 2025 10:14:45 +0100 Subject: [PATCH 1/4] version bump --- config/version.txt | 2 +- .../java/co/elastic/clients/transport/VersionInfo.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version.txt b/config/version.txt index 83512a6bf..767ca46e8 100644 --- a/config/version.txt +++ b/config/version.txt @@ -1 +1 @@ -8.17.3 +8.17.4 diff --git a/java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java b/java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java index c1684c2b0..3058ab58b 100644 --- a/java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java +++ b/java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java @@ -22,5 +22,5 @@ // Package private class VersionInfo { static final String FLAVOR = "stack"; - static final String VERSION = "8.17.3"; + static final String VERSION = "8.17.4"; } From 99ff263fce76015afd52438dbd506b63930a90fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 12:17:39 +0100 Subject: [PATCH 2/4] json enum case insensitive (#941) (#959) Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com> --- .../src/main/java/co/elastic/clients/json/JsonEnums.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java-client/src/main/java/co/elastic/clients/json/JsonEnums.java b/java-client/src/main/java/co/elastic/clients/json/JsonEnums.java index 58b525190..e6a49b840 100644 --- a/java-client/src/main/java/co/elastic/clients/json/JsonEnums.java +++ b/java-client/src/main/java/co/elastic/clients/json/JsonEnums.java @@ -53,12 +53,12 @@ protected Deserializer(T[] values, EnumSet acceptedEvents) { for (T member : values) { String jsonValue = member.jsonValue(); if (jsonValue != null) { // _Custom enum members have a null jsonValue - this.lookupTable.put(jsonValue, member); + this.lookupTable.put(jsonValue.toLowerCase(), member); // lookup must be case-insensitive } String[] aliases = member.aliases(); if (aliases != null) { for (String alias: aliases) { - this.lookupTable.put(alias, member); + this.lookupTable.put(alias.toLowerCase(), member); } } } @@ -79,7 +79,7 @@ public T deserialize(JsonParser parser, JsonpMapper mapper, JsonParser.Event eve * @throws JsonParsingException if no matching enum was found */ public T deserialize(String value, JsonParser parser) { - T result = this.lookupTable.get(value); + T result = this.lookupTable.get(value.toLowerCase()); if (result == null) { throw new JsonpMappingException("Invalid enum '" + value + "'", parser.getLocation()); } @@ -94,7 +94,7 @@ public T deserialize(String value, JsonParser parser) { * @throws IllegalArgumentException if no matching enum was found */ public T parse(String value) { - T result = this.lookupTable.get(value); + T result = this.lookupTable.get(value.toLowerCase()); if (result == null) { throw new NoSuchElementException("Invalid enum '" + value + "'"); } From b5574fa6402c5eb8e33b7091cb37ffbef68abd25 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Fri, 7 Mar 2025 12:18:06 +0100 Subject: [PATCH 3/4] [codegen] update to latest spec --- .../_types/query_dsl/GeoGridQuery.java | 290 ++++++++++++++++++ .../query_dsl/GeoGridQueryBuilders.java | 52 ++++ .../_types/query_dsl/GeoGridQueryVariant.java | 44 +++ .../elasticsearch/_types/query_dsl/Query.java | 30 ++ .../_types/query_dsl/QueryBuilders.java | 17 + .../connector/UpdateErrorRequest.java | 3 +- .../connector/UpdateIndexNameRequest.java | 3 +- .../elasticsearch/doc-files/api-spec.html | 131 ++++---- .../elasticsearch/indices/IndexSettings.java | 3 +- .../elasticsearch/simulate/IngestRequest.java | 46 +-- 10 files changed, 525 insertions(+), 94 deletions(-) create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQuery.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQueryBuilders.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQueryVariant.java diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQuery.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQuery.java new file mode 100644 index 000000000..f1551cd19 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQuery.java @@ -0,0 +1,290 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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 + * + * http://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 co.elastic.clients.elasticsearch._types.query_dsl; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.query_dsl.GeoGridQuery + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GeoGridQuery extends QueryBase + implements + TaggedUnion, + QueryVariant, + JsonpSerializable { + + /** + * {@link GeoGridQuery} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Geogrid("geogrid"), + + Geohash("geohash"), + + Geohex("geohex"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + /** + * Query variant kind. + */ + @Override + public Query.Kind _queryKind() { + return Query.Kind.GeoGrid; + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + // Single key dictionary + private final String field; + + private GeoGridQuery(Builder builder) { + super(builder); + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static GeoGridQuery of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The target field + */ + public final String field() { + return this.field; + } + + /** + * Is this variant instance of kind {@code geogrid}? + */ + public boolean isGeogrid() { + return _kind == Kind.Geogrid; + } + + /** + * Get the {@code geogrid} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code geogrid} kind. + */ + public String geogrid() { + return TaggedUnionUtils.get(this, Kind.Geogrid); + } + + /** + * Is this variant instance of kind {@code geohash}? + */ + public boolean isGeohash() { + return _kind == Kind.Geohash; + } + + /** + * Get the {@code geohash} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code geohash} kind. + */ + public String geohash() { + return TaggedUnionUtils.get(this, Kind.Geohash); + } + + /** + * Is this variant instance of kind {@code geohex}? + */ + public boolean isGeohex() { + return _kind == Kind.Geohex; + } + + /** + * Get the {@code geohex} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code geohex} kind. + */ + public String geohex() { + return TaggedUnionUtils.get(this, Kind.Geohex); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + generator.writeStartObject(this.field); + + super.serializeInternal(generator, mapper); + + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } else { + switch (_kind) { + case Geogrid : + generator.write(((String) this._value)); + + break; + case Geohash : + generator.write(((String) this._value)); + + break; + case Geohex : + generator.write(((String) this._value)); + + break; + } + } + + generator.writeEnd(); + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { + private Kind _kind; + private Object _value; + + private String field; + + /** + * Required - The target field + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + public ObjectBuilder geogrid(String v) { + this._kind = Kind.Geogrid; + this._value = v; + return this; + } + + public ObjectBuilder geohash(String v) { + this._kind = Kind.Geohash; + this._value = v; + return this; + } + + public ObjectBuilder geohex(String v) { + this._kind = Kind.Geohex; + this._value = v; + return this; + } + + public GeoGridQuery build() { + _checkSingleUse(); + return new GeoGridQuery(this); + } + + } + + protected static void setupGeoGridQueryDeserializer(ObjectDeserializer op) { + QueryBase.setupQueryBaseDeserializer(op); + op.add(Builder::geogrid, JsonpDeserializer.stringDeserializer(), "geogrid"); + op.add(Builder::geohash, JsonpDeserializer.stringDeserializer(), "geohash"); + op.add(Builder::geohex, JsonpDeserializer.stringDeserializer(), "geohex"); + + op.setKey(Builder::field, JsonpDeserializer.stringDeserializer()); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + GeoGridQuery::setupGeoGridQueryDeserializer, Builder::build); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQueryBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQueryBuilders.java new file mode 100644 index 000000000..ac50148d6 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQueryBuilders.java @@ -0,0 +1,52 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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 + * + * http://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 co.elastic.clients.elasticsearch._types.query_dsl; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link GeoGridQuery} variants. + *

+ * Variants geogrid, geohash, geohex are + * not available here as they don't have a dedicated class. Use + * {@link GeoGridQuery}'s builder for these. + * + */ +public class GeoGridQueryBuilders { + private GeoGridQueryBuilders() { + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQueryVariant.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQueryVariant.java new file mode 100644 index 000000000..4f7f15f2b --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoGridQueryVariant.java @@ -0,0 +1,44 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you 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 + * + * http://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 co.elastic.clients.elasticsearch._types.query_dsl; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link GeoGridQuery} variants. + */ +public interface GeoGridQueryVariant { + + GeoGridQuery.Kind _geoGridQueryKind(); + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java index 92de0ee6e..d1f8186b5 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java @@ -103,6 +103,8 @@ public enum Kind implements JsonEnum { GeoDistance("geo_distance"), + GeoGrid("geo_grid"), + GeoPolygon("geo_polygon"), GeoShape("geo_shape"), @@ -464,6 +466,23 @@ public GeoDistanceQuery geoDistance() { return TaggedUnionUtils.get(this, Kind.GeoDistance); } + /** + * Is this variant instance of kind {@code geo_grid}? + */ + public boolean isGeoGrid() { + return _kind == Kind.GeoGrid; + } + + /** + * Get the {@code geo_grid} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code geo_grid} kind. + */ + public GeoGridQuery geoGrid() { + return TaggedUnionUtils.get(this, Kind.GeoGrid); + } + /** * Is this variant instance of kind {@code geo_polygon}? */ @@ -1470,6 +1489,16 @@ public ObjectBuilder geoDistance( return this.geoDistance(fn.apply(new GeoDistanceQuery.Builder()).build()); } + public ObjectBuilder geoGrid(GeoGridQuery v) { + this._kind = Kind.GeoGrid; + this._value = v; + return this; + } + + public ObjectBuilder geoGrid(Function> fn) { + return this.geoGrid(fn.apply(new GeoGridQuery.Builder()).build()); + } + public ObjectBuilder geoPolygon(GeoPolygonQuery v) { this._kind = Kind.GeoPolygon; this._value = v; @@ -2001,6 +2030,7 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) { op.add(Builder::fuzzy, FuzzyQuery._DESERIALIZER, "fuzzy"); op.add(Builder::geoBoundingBox, GeoBoundingBoxQuery._DESERIALIZER, "geo_bounding_box"); op.add(Builder::geoDistance, GeoDistanceQuery._DESERIALIZER, "geo_distance"); + op.add(Builder::geoGrid, GeoGridQuery._DESERIALIZER, "geo_grid"); op.add(Builder::geoPolygon, GeoPolygonQuery._DESERIALIZER, "geo_polygon"); op.add(Builder::geoShape, GeoShapeQuery._DESERIALIZER, "geo_shape"); op.add(Builder::hasChild, HasChildQuery._DESERIALIZER, "has_child"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java index 33d581d8d..3b1beb151 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java @@ -252,6 +252,23 @@ public static Query geoDistance(Function> fn) { + Query.Builder builder = new Query.Builder(); + builder.geoGrid(fn.apply(new GeoGridQuery.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link GeoPolygonQuery geo_polygon} {@code Query} * variant. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/connector/UpdateErrorRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/connector/UpdateErrorRequest.java index 94160d95e..125a13595 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/connector/UpdateErrorRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/connector/UpdateErrorRequest.java @@ -31,7 +31,6 @@ import co.elastic.clients.transport.endpoints.SimpleEndpoint; import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.JsonValue; import jakarta.json.stream.JsonGenerator; import java.lang.String; import java.util.Collections; @@ -125,7 +124,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { else if (isExpNullError) { generator.writeKey("error"); - generator.write(JsonValue.NULL); + generator.writeNull(); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/connector/UpdateIndexNameRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/connector/UpdateIndexNameRequest.java index b4244c940..463c9cd8f 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/connector/UpdateIndexNameRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/connector/UpdateIndexNameRequest.java @@ -31,7 +31,6 @@ import co.elastic.clients.transport.endpoints.SimpleEndpoint; import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.JsonValue; import jakarta.json.stream.JsonGenerator; import java.lang.String; import java.util.Collections; @@ -125,7 +124,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { else if (isExpNullIndexName) { generator.writeKey("index_name"); - generator.write(JsonValue.NULL); + generator.writeNull(); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 7f1e0050a..08b635e4e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -869,9 +869,9 @@ '_types.query_dsl.BoolQuery': '_types/query_dsl/compound.ts#L29-L56', '_types.query_dsl.BoostingQuery': '_types/query_dsl/compound.ts#L58-L74', '_types.query_dsl.ChildScoreMode': '_types/query_dsl/joining.ts#L25-L39', -'_types.query_dsl.CombinedFieldsOperator': '_types/query_dsl/abstractions.ts#L513-L516', -'_types.query_dsl.CombinedFieldsQuery': '_types/query_dsl/abstractions.ts#L466-L500', -'_types.query_dsl.CombinedFieldsZeroTerms': '_types/query_dsl/abstractions.ts#L518-L527', +'_types.query_dsl.CombinedFieldsOperator': '_types/query_dsl/abstractions.ts#L519-L522', +'_types.query_dsl.CombinedFieldsQuery': '_types/query_dsl/abstractions.ts#L472-L506', +'_types.query_dsl.CombinedFieldsZeroTerms': '_types/query_dsl/abstractions.ts#L524-L533', '_types.query_dsl.CommonTermsQuery': '_types/query_dsl/fulltext.ts#L34-L44', '_types.query_dsl.ConstantScoreQuery': '_types/query_dsl/compound.ts#L76-L86', '_types.query_dsl.DateDecayFunction': '_types/query_dsl/compound.ts#L209-L209', @@ -884,8 +884,8 @@ '_types.query_dsl.DistanceFeatureQuery': '_types/query_dsl/specialized.ts#L76-L85', '_types.query_dsl.DistanceFeatureQueryBase': '_types/query_dsl/specialized.ts#L39-L59', '_types.query_dsl.ExistsQuery': '_types/query_dsl/term.ts#L38-L46', -'_types.query_dsl.FieldAndFormat': '_types/query_dsl/abstractions.ts#L529-L543', -'_types.query_dsl.FieldLookup': '_types/query_dsl/abstractions.ts#L430-L447', +'_types.query_dsl.FieldAndFormat': '_types/query_dsl/abstractions.ts#L535-L549', +'_types.query_dsl.FieldLookup': '_types/query_dsl/abstractions.ts#L436-L453', '_types.query_dsl.FieldValueFactorModifier': '_types/query_dsl/compound.ts#L323-L366', '_types.query_dsl.FieldValueFactorScoreFunction': '_types/query_dsl/compound.ts#L149-L168', '_types.query_dsl.FunctionBoostMode': '_types/query_dsl/compound.ts#L295-L321', @@ -893,16 +893,17 @@ '_types.query_dsl.FunctionScoreMode': '_types/query_dsl/compound.ts#L268-L293', '_types.query_dsl.FunctionScoreQuery': '_types/query_dsl/compound.ts#L105-L135', '_types.query_dsl.FuzzyQuery': '_types/query_dsl/term.ts#L48-L86', -'_types.query_dsl.GeoBoundingBoxQuery': '_types/query_dsl/geo.ts#L32-L54', +'_types.query_dsl.GeoBoundingBoxQuery': '_types/query_dsl/geo.ts#L35-L57', '_types.query_dsl.GeoDecayFunction': '_types/query_dsl/compound.ts#L210-L213', '_types.query_dsl.GeoDistanceFeatureQuery': '_types/query_dsl/specialized.ts#L66-L69', -'_types.query_dsl.GeoDistanceQuery': '_types/query_dsl/geo.ts#L61-L93', -'_types.query_dsl.GeoExecution': '_types/query_dsl/geo.ts#L56-L59', -'_types.query_dsl.GeoPolygonPoints': '_types/query_dsl/geo.ts#L95-L97', -'_types.query_dsl.GeoPolygonQuery': '_types/query_dsl/geo.ts#L99-L111', -'_types.query_dsl.GeoShapeFieldQuery': '_types/query_dsl/geo.ts#L118-L129', -'_types.query_dsl.GeoShapeQuery': '_types/query_dsl/geo.ts#L131-L147', -'_types.query_dsl.GeoValidationMethod': '_types/query_dsl/geo.ts#L163-L173', +'_types.query_dsl.GeoDistanceQuery': '_types/query_dsl/geo.ts#L64-L96', +'_types.query_dsl.GeoExecution': '_types/query_dsl/geo.ts#L59-L62', +'_types.query_dsl.GeoGridQuery': '_types/query_dsl/geo.ts#L98-L103', +'_types.query_dsl.GeoPolygonPoints': '_types/query_dsl/geo.ts#L105-L107', +'_types.query_dsl.GeoPolygonQuery': '_types/query_dsl/geo.ts#L109-L121', +'_types.query_dsl.GeoShapeFieldQuery': '_types/query_dsl/geo.ts#L128-L139', +'_types.query_dsl.GeoShapeQuery': '_types/query_dsl/geo.ts#L141-L157', +'_types.query_dsl.GeoValidationMethod': '_types/query_dsl/geo.ts#L173-L183', '_types.query_dsl.HasChildQuery': '_types/query_dsl/joining.ts#L41-L79', '_types.query_dsl.HasParentQuery': '_types/query_dsl/joining.ts#L81-L110', '_types.query_dsl.IdsQuery': '_types/query_dsl/term.ts#L88-L96', @@ -935,8 +936,8 @@ '_types.query_dsl.PinnedDoc': '_types/query_dsl/specialized.ts#L269-L278', '_types.query_dsl.PinnedQuery': '_types/query_dsl/specialized.ts#L247-L267', '_types.query_dsl.PrefixQuery': '_types/query_dsl/term.ts#L98-L120', -'_types.query_dsl.QueryBase': '_types/query_dsl/abstractions.ts#L453-L464', -'_types.query_dsl.QueryContainer': '_types/query_dsl/abstractions.ts#L102-L428', +'_types.query_dsl.QueryBase': '_types/query_dsl/abstractions.ts#L459-L470', +'_types.query_dsl.QueryContainer': '_types/query_dsl/abstractions.ts#L103-L434', '_types.query_dsl.QueryStringQuery': '_types/query_dsl/fulltext.ts#L598-L721', '_types.query_dsl.RandomScoreFunction': '_types/query_dsl/compound.ts#L144-L147', '_types.query_dsl.RangeQuery': '_types/query_dsl/term.ts#L176-L186', @@ -984,7 +985,7 @@ '_types.query_dsl.UntypedRangeQuery': '_types/query_dsl/term.ts#L150-L159', '_types.query_dsl.WeightedTokensQuery': '_types/query_dsl/WeightedTokensQuery.ts#L25-L33', '_types.query_dsl.WildcardQuery': '_types/query_dsl/term.ts#L305-L325', -'_types.query_dsl.WrapperQuery': '_types/query_dsl/abstractions.ts#L502-L511', +'_types.query_dsl.WrapperQuery': '_types/query_dsl/abstractions.ts#L508-L517', '_types.query_dsl.ZeroTermsQuery': '_types/query_dsl/fulltext.ts#L587-L596', 'async_search._types.AsyncSearch': 'async_search/_types/AsyncSearch.ts#L30-L56', 'async_search._types.AsyncSearchDocumentResponseBase': 'async_search/_types/AsyncSearchResponseBase.ts#L50-L54', @@ -1417,7 +1418,7 @@ 'ilm.stop.Response': 'ilm/stop/StopIlmResponse.ts#L22-L24', 'indices._types.Alias': 'indices/_types/Alias.ts#L23-L53', 'indices._types.AliasDefinition': 'indices/_types/AliasDefinition.ts#L22-L54', -'indices._types.CacheQueries': 'indices/_types/IndexSettings.ts#L415-L417', +'indices._types.CacheQueries': 'indices/_types/IndexSettings.ts#L421-L423', 'indices._types.DataStream': 'indices/_types/DataStream.ts#L45-L127', 'indices._types.DataStreamIndex': 'indices/_types/DataStream.ts#L136-L157', 'indices._types.DataStreamLifecycle': 'indices/_types/DataStreamLifecycle.ts#L25-L31', @@ -1430,7 +1431,7 @@ 'indices._types.DownsamplingRound': 'indices/_types/DownsamplingRound.ts#L23-L32', 'indices._types.FailureStore': 'indices/_types/DataStream.ts#L39-L43', 'indices._types.FielddataFrequencyFilter': 'indices/_types/FielddataFrequencyFilter.ts#L22-L26', -'indices._types.IndexCheckOnStartup': 'indices/_types/IndexSettings.ts#L264-L271', +'indices._types.IndexCheckOnStartup': 'indices/_types/IndexSettings.ts#L270-L277', 'indices._types.IndexRouting': 'indices/_types/IndexRouting.ts#L22-L25', 'indices._types.IndexRoutingAllocation': 'indices/_types/IndexRouting.ts#L27-L32', 'indices._types.IndexRoutingAllocationDisk': 'indices/_types/IndexRouting.ts#L62-L64', @@ -1440,64 +1441,64 @@ 'indices._types.IndexRoutingRebalance': 'indices/_types/IndexRouting.ts#L34-L36', 'indices._types.IndexRoutingRebalanceOptions': 'indices/_types/IndexRouting.ts#L45-L50', 'indices._types.IndexSegmentSort': 'indices/_types/IndexSegmentSort.ts#L22-L27', -'indices._types.IndexSettingBlocks': 'indices/_types/IndexSettings.ts#L256-L262', -'indices._types.IndexSettings': 'indices/_types/IndexSettings.ts#L70-L170', -'indices._types.IndexSettingsAnalysis': 'indices/_types/IndexSettings.ts#L327-L333', -'indices._types.IndexSettingsLifecycle': 'indices/_types/IndexSettings.ts#L278-L317', -'indices._types.IndexSettingsLifecycleStep': 'indices/_types/IndexSettings.ts#L319-L325', -'indices._types.IndexSettingsTimeSeries': 'indices/_types/IndexSettings.ts#L335-L338', +'indices._types.IndexSettingBlocks': 'indices/_types/IndexSettings.ts#L262-L268', +'indices._types.IndexSettings': 'indices/_types/IndexSettings.ts#L70-L176', +'indices._types.IndexSettingsAnalysis': 'indices/_types/IndexSettings.ts#L333-L339', +'indices._types.IndexSettingsLifecycle': 'indices/_types/IndexSettings.ts#L284-L323', +'indices._types.IndexSettingsLifecycleStep': 'indices/_types/IndexSettings.ts#L325-L331', +'indices._types.IndexSettingsTimeSeries': 'indices/_types/IndexSettings.ts#L341-L344', 'indices._types.IndexState': 'indices/_types/IndexState.ts#L27-L40', 'indices._types.IndexTemplate': 'indices/_types/IndexTemplate.ts#L28-L81', 'indices._types.IndexTemplateDataStreamConfiguration': 'indices/_types/IndexTemplate.ts#L83-L94', 'indices._types.IndexTemplateSummary': 'indices/_types/IndexTemplate.ts#L96-L118', -'indices._types.IndexVersioning': 'indices/_types/IndexSettings.ts#L273-L276', -'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L569-L571', -'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L573-L580', -'indices._types.IndexingSlowlogSettings': 'indices/_types/IndexSettings.ts#L582-L587', -'indices._types.IndexingSlowlogTresholds': 'indices/_types/IndexSettings.ts#L589-L596', +'indices._types.IndexVersioning': 'indices/_types/IndexSettings.ts#L279-L282', +'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L575-L577', +'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L579-L586', +'indices._types.IndexingSlowlogSettings': 'indices/_types/IndexSettings.ts#L588-L593', +'indices._types.IndexingSlowlogTresholds': 'indices/_types/IndexSettings.ts#L595-L602', 'indices._types.ManagedBy': 'indices/_types/DataStream.ts#L32-L37', -'indices._types.MappingLimitSettings': 'indices/_types/IndexSettings.ts#L419-L433', -'indices._types.MappingLimitSettingsDepth': 'indices/_types/IndexSettings.ts#L454-L461', -'indices._types.MappingLimitSettingsDimensionFields': 'indices/_types/IndexSettings.ts#L491-L497', -'indices._types.MappingLimitSettingsFieldNameLength': 'indices/_types/IndexSettings.ts#L482-L489', -'indices._types.MappingLimitSettingsNestedFields': 'indices/_types/IndexSettings.ts#L463-L471', -'indices._types.MappingLimitSettingsNestedObjects': 'indices/_types/IndexSettings.ts#L473-L480', -'indices._types.MappingLimitSettingsSourceFields': 'indices/_types/IndexSettings.ts#L499-L501', -'indices._types.MappingLimitSettingsTotalFields': 'indices/_types/IndexSettings.ts#L435-L452', -'indices._types.Merge': 'indices/_types/IndexSettings.ts#L340-L342', -'indices._types.MergeScheduler': 'indices/_types/IndexSettings.ts#L344-L347', +'indices._types.MappingLimitSettings': 'indices/_types/IndexSettings.ts#L425-L439', +'indices._types.MappingLimitSettingsDepth': 'indices/_types/IndexSettings.ts#L460-L467', +'indices._types.MappingLimitSettingsDimensionFields': 'indices/_types/IndexSettings.ts#L497-L503', +'indices._types.MappingLimitSettingsFieldNameLength': 'indices/_types/IndexSettings.ts#L488-L495', +'indices._types.MappingLimitSettingsNestedFields': 'indices/_types/IndexSettings.ts#L469-L477', +'indices._types.MappingLimitSettingsNestedObjects': 'indices/_types/IndexSettings.ts#L479-L486', +'indices._types.MappingLimitSettingsSourceFields': 'indices/_types/IndexSettings.ts#L505-L507', +'indices._types.MappingLimitSettingsTotalFields': 'indices/_types/IndexSettings.ts#L441-L458', +'indices._types.Merge': 'indices/_types/IndexSettings.ts#L346-L348', +'indices._types.MergeScheduler': 'indices/_types/IndexSettings.ts#L350-L353', 'indices._types.NumericFielddata': 'indices/_types/NumericFielddata.ts#L22-L24', 'indices._types.NumericFielddataFormat': 'indices/_types/NumericFielddataFormat.ts#L20-L23', -'indices._types.Queries': 'indices/_types/IndexSettings.ts#L411-L413', +'indices._types.Queries': 'indices/_types/IndexSettings.ts#L417-L419', 'indices._types.RetentionLease': 'indices/_types/IndexSettings.ts#L66-L68', -'indices._types.SearchIdle': 'indices/_types/IndexSettings.ts#L247-L250', +'indices._types.SearchIdle': 'indices/_types/IndexSettings.ts#L253-L256', 'indices._types.SegmentSortMissing': 'indices/_types/IndexSegmentSort.ts#L43-L46', 'indices._types.SegmentSortMode': 'indices/_types/IndexSegmentSort.ts#L36-L41', 'indices._types.SegmentSortOrder': 'indices/_types/IndexSegmentSort.ts#L29-L34', -'indices._types.SettingsAnalyze': 'indices/_types/IndexSettings.ts#L237-L240', -'indices._types.SettingsHighlight': 'indices/_types/IndexSettings.ts#L232-L235', -'indices._types.SettingsQueryString': 'indices/_types/IndexSettings.ts#L252-L254', -'indices._types.SettingsSearch': 'indices/_types/IndexSettings.ts#L242-L245', -'indices._types.SettingsSimilarity': 'indices/_types/IndexSettings.ts#L172-L184', -'indices._types.SettingsSimilarityBm25': 'indices/_types/IndexSettings.ts#L190-L195', -'indices._types.SettingsSimilarityBoolean': 'indices/_types/IndexSettings.ts#L186-L188', -'indices._types.SettingsSimilarityDfi': 'indices/_types/IndexSettings.ts#L197-L200', -'indices._types.SettingsSimilarityDfr': 'indices/_types/IndexSettings.ts#L202-L207', -'indices._types.SettingsSimilarityIb': 'indices/_types/IndexSettings.ts#L209-L214', -'indices._types.SettingsSimilarityLmd': 'indices/_types/IndexSettings.ts#L216-L219', -'indices._types.SettingsSimilarityLmj': 'indices/_types/IndexSettings.ts#L221-L224', -'indices._types.SettingsSimilarityScripted': 'indices/_types/IndexSettings.ts#L226-L230', -'indices._types.SlowlogSettings': 'indices/_types/IndexSettings.ts#L509-L514', -'indices._types.SlowlogTresholdLevels': 'indices/_types/IndexSettings.ts#L521-L526', -'indices._types.SlowlogTresholds': 'indices/_types/IndexSettings.ts#L516-L519', +'indices._types.SettingsAnalyze': 'indices/_types/IndexSettings.ts#L243-L246', +'indices._types.SettingsHighlight': 'indices/_types/IndexSettings.ts#L238-L241', +'indices._types.SettingsQueryString': 'indices/_types/IndexSettings.ts#L258-L260', +'indices._types.SettingsSearch': 'indices/_types/IndexSettings.ts#L248-L251', +'indices._types.SettingsSimilarity': 'indices/_types/IndexSettings.ts#L178-L190', +'indices._types.SettingsSimilarityBm25': 'indices/_types/IndexSettings.ts#L196-L201', +'indices._types.SettingsSimilarityBoolean': 'indices/_types/IndexSettings.ts#L192-L194', +'indices._types.SettingsSimilarityDfi': 'indices/_types/IndexSettings.ts#L203-L206', +'indices._types.SettingsSimilarityDfr': 'indices/_types/IndexSettings.ts#L208-L213', +'indices._types.SettingsSimilarityIb': 'indices/_types/IndexSettings.ts#L215-L220', +'indices._types.SettingsSimilarityLmd': 'indices/_types/IndexSettings.ts#L222-L225', +'indices._types.SettingsSimilarityLmj': 'indices/_types/IndexSettings.ts#L227-L230', +'indices._types.SettingsSimilarityScripted': 'indices/_types/IndexSettings.ts#L232-L236', +'indices._types.SlowlogSettings': 'indices/_types/IndexSettings.ts#L515-L520', +'indices._types.SlowlogTresholdLevels': 'indices/_types/IndexSettings.ts#L527-L532', +'indices._types.SlowlogTresholds': 'indices/_types/IndexSettings.ts#L522-L525', 'indices._types.SoftDeletes': 'indices/_types/IndexSettings.ts#L51-L64', -'indices._types.SourceMode': 'indices/_types/IndexSettings.ts#L503-L507', -'indices._types.Storage': 'indices/_types/IndexSettings.ts#L528-L537', -'indices._types.StorageType': 'indices/_types/IndexSettings.ts#L539-L567', +'indices._types.SourceMode': 'indices/_types/IndexSettings.ts#L509-L513', +'indices._types.Storage': 'indices/_types/IndexSettings.ts#L534-L543', +'indices._types.StorageType': 'indices/_types/IndexSettings.ts#L545-L573', 'indices._types.TemplateMapping': 'indices/_types/TemplateMapping.ts#L27-L34', -'indices._types.Translog': 'indices/_types/IndexSettings.ts#L349-L371', -'indices._types.TranslogDurability': 'indices/_types/IndexSettings.ts#L373-L388', -'indices._types.TranslogRetention': 'indices/_types/IndexSettings.ts#L390-L409', +'indices._types.Translog': 'indices/_types/IndexSettings.ts#L355-L377', +'indices._types.TranslogDurability': 'indices/_types/IndexSettings.ts#L379-L394', +'indices._types.TranslogRetention': 'indices/_types/IndexSettings.ts#L396-L415', 'indices.add_block.IndicesBlockOptions': 'indices/add_block/IndicesAddBlockRequest.ts#L45-L50', 'indices.add_block.IndicesBlockStatus': 'indices/add_block/IndicesAddBlockResponse.ts#L30-L33', 'indices.add_block.Request': 'indices/add_block/IndicesAddBlockRequest.ts#L24-L43', @@ -3043,10 +3044,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/97380c530a4522f3199d6ab4ae6adfa142662301/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/e877c1b1f1ef87450a1e03b84932409be800e0b0/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java index 275fdfca1..939ef788b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java @@ -32,7 +32,6 @@ import co.elastic.clients.util.DateTime; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.JsonValue; import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; import java.lang.Integer; @@ -875,7 +874,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { else if (isExpNullAutoExpandReplicas) { generator.writeKey("auto_expand_replicas"); - generator.write(JsonValue.NULL); + generator.writeNull(); } if (this.merge != null) { diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/simulate/IngestRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/simulate/IngestRequest.java index a3eec39f1..f795c6f16 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/simulate/IngestRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/simulate/IngestRequest.java @@ -106,7 +106,7 @@ public class IngestRequest extends RequestBase implements JsonpSerializable { @Nullable private final String index; - private final Map indexTemplateSubtitutions; + private final Map indexTemplateSubstitutions; @Nullable private final TypeMapping mappingAddition; @@ -123,7 +123,7 @@ private IngestRequest(Builder builder) { this.componentTemplateSubstitutions = ApiTypeHelper.unmodifiable(builder.componentTemplateSubstitutions); this.docs = ApiTypeHelper.unmodifiableRequired(builder.docs, this, "docs"); this.index = builder.index; - this.indexTemplateSubtitutions = ApiTypeHelper.unmodifiable(builder.indexTemplateSubtitutions); + this.indexTemplateSubstitutions = ApiTypeHelper.unmodifiable(builder.indexTemplateSubstitutions); this.mappingAddition = builder.mappingAddition; this.pipeline = builder.pipeline; this.pipelineSubstitutions = ApiTypeHelper.unmodifiable(builder.pipelineSubstitutions); @@ -170,10 +170,10 @@ public final String index() { * A map of index template names to substitute index template definition * objects. *

- * API name: {@code index_template_subtitutions} + * API name: {@code index_template_substitutions} */ - public final Map indexTemplateSubtitutions() { - return this.indexTemplateSubtitutions; + public final Map indexTemplateSubstitutions() { + return this.indexTemplateSubstitutions; } /** @@ -238,10 +238,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (ApiTypeHelper.isDefined(this.indexTemplateSubtitutions)) { - generator.writeKey("index_template_subtitutions"); + if (ApiTypeHelper.isDefined(this.indexTemplateSubstitutions)) { + generator.writeKey("index_template_substitutions"); generator.writeStartObject(); - for (Map.Entry item0 : this.indexTemplateSubtitutions.entrySet()) { + for (Map.Entry item0 : this.indexTemplateSubstitutions.entrySet()) { generator.writeKey(item0.getKey()); item0.getValue().serialize(generator, mapper); @@ -284,7 +284,7 @@ public static class Builder extends RequestBase.AbstractBuilder impleme private String index; @Nullable - private Map indexTemplateSubtitutions; + private Map indexTemplateSubstitutions; @Nullable private TypeMapping mappingAddition; @@ -388,13 +388,13 @@ public final Builder index(@Nullable String value) { * A map of index template names to substitute index template definition * objects. *

- * API name: {@code index_template_subtitutions} + * API name: {@code index_template_substitutions} *

* Adds all entries of map to - * indexTemplateSubtitutions. + * indexTemplateSubstitutions. */ - public final Builder indexTemplateSubtitutions(Map map) { - this.indexTemplateSubtitutions = _mapPutAll(this.indexTemplateSubtitutions, map); + public final Builder indexTemplateSubstitutions(Map map) { + this.indexTemplateSubstitutions = _mapPutAll(this.indexTemplateSubstitutions, map); return this; } @@ -402,12 +402,12 @@ public final Builder indexTemplateSubtitutions(Map map) { * A map of index template names to substitute index template definition * objects. *

- * API name: {@code index_template_subtitutions} + * API name: {@code index_template_substitutions} *

- * Adds an entry to indexTemplateSubtitutions. + * Adds an entry to indexTemplateSubstitutions. */ - public final Builder indexTemplateSubtitutions(String key, IndexTemplate value) { - this.indexTemplateSubtitutions = _mapPut(this.indexTemplateSubtitutions, key, value); + public final Builder indexTemplateSubstitutions(String key, IndexTemplate value) { + this.indexTemplateSubstitutions = _mapPut(this.indexTemplateSubstitutions, key, value); return this; } @@ -415,14 +415,14 @@ public final Builder indexTemplateSubtitutions(String key, IndexTemplate value) * A map of index template names to substitute index template definition * objects. *

- * API name: {@code index_template_subtitutions} + * API name: {@code index_template_substitutions} *

- * Adds an entry to indexTemplateSubtitutions using a builder + * Adds an entry to indexTemplateSubstitutions using a builder * lambda. */ - public final Builder indexTemplateSubtitutions(String key, + public final Builder indexTemplateSubstitutions(String key, Function> fn) { - return indexTemplateSubtitutions(key, fn.apply(new IndexTemplate.Builder()).build()); + return indexTemplateSubstitutions(key, fn.apply(new IndexTemplate.Builder()).build()); } /** @@ -524,8 +524,8 @@ protected static void setupIngestRequestDeserializer(ObjectDeserializer Date: Tue, 18 Mar 2025 17:12:24 +0100 Subject: [PATCH 4/4] maven central release with nexux plugin (#961) --- .ci/configure_signing.sh | 51 ++++++++++++++++++++++++++++++++++++ .ci/make.sh | 19 ++++++++++++++ build.gradle.kts | 21 +++++++++++++++ java-client/build.gradle.kts | 4 ++- settings.gradle.kts | 16 +---------- 5 files changed, 95 insertions(+), 16 deletions(-) create mode 100755 .ci/configure_signing.sh diff --git a/.ci/configure_signing.sh b/.ci/configure_signing.sh new file mode 100755 index 000000000..e67e99af5 --- /dev/null +++ b/.ci/configure_signing.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you 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 +# +# http://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. +# + +#see https://central.sonatype.org/publish/publish-gradle/#distributing-your-public-key + +set -euo pipefail + +if grep -sq "signing.keyId" gradle.properties; then + # Keys already present + exit 0 +fi + +mkdir -p /tmp/secured +keyring_file="/tmp/secured/keyring.gpg" + +vault_path="kv/ci-shared/release-eng/team-release-secrets/elasticsearch-java" + +vault kv get --field="keyring" $vault_path/gpg | base64 -d > $keyring_file +## NOTE: passphase is the name of the field. +signing_password=$(vault kv get --field="passphase" $vault_path/gpg) +signing_key=$(vault kv get --field="key_id" $vault_path/gpg) + +maven_username=$(vault kv get --field="username" $vault_path/maven_central) +maven_password=$(vault kv get --field="password" $vault_path/maven_central) + +cat >> gradle.properties < config/version.txt fi diff --git a/build.gradle.kts b/build.gradle.kts index 0e6b4091d..6bdb65b56 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,6 +16,27 @@ * specific language governing permissions and limitations * under the License. */ +plugins { + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" +} + +nexusPublishing { + repositories { + sonatype() + } +} + +repositories { + mavenCentral() +} + +group = "co.elastic.clients" +description = "Maven central release of the official elasticsearch java client" + +subprojects { + group = rootProject.group + version = rootProject.version +} allprojects { group = "co.elastic.clients" diff --git a/java-client/build.gradle.kts b/java-client/build.gradle.kts index aeef67fe1..d445b480d 100644 --- a/java-client/build.gradle.kts +++ b/java-client/build.gradle.kts @@ -25,8 +25,10 @@ import java.io.FileWriter plugins { java `java-library` - checkstyle `maven-publish` + publishing + checkstyle + signing id("com.github.jk1.dependency-license-report") version "2.2" id("de.thetaphi.forbiddenapis") version "3.4" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 1f0d5a7e7..8e5d8b347 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,18 +21,4 @@ import java.nio.file.Paths rootProject.name = "elasticsearch-java" -// Include as subprojects all subdirectories that have a "build.gradle.kts" and no ".gradle-standalone" -fun listFiles(dir: File){ - (dir.listFiles() ?: arrayOf()). - filter { File(it, "build.gradle.kts").exists() }. - filter { !File(it, ".gradle-standalone").exists() }. - filter { it.name != "buildSrc" }. - toTypedArray(). - forEach { dir -> - include(dir.name) - project(":" + dir.name).projectDir = dir - } -} - -listFiles(rootProject.projectDir) -listFiles(Paths.get(rootProject.projectDir.path,"examples").toFile()) +include("java-client")