diff --git a/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java b/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java index 6188d3e..ef20e7c 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java +++ b/elx-api/src/main/java/org/xbib/elx/api/BasicClient.java @@ -3,12 +3,13 @@ package org.xbib.elx.api; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; import java.io.Closeable; +import java.io.IOException; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; public interface BasicClient extends Closeable { - boolean init(Settings settings, String info); + boolean init(Settings settings, String info) throws IOException; void putClusterSetting(String key, Object value, long timeout, TimeUnit timeUnit); diff --git a/elx-common/build.gradle b/elx-common/build.gradle index f59c9cd..d8f8495 100644 --- a/elx-common/build.gradle +++ b/elx-common/build.gradle @@ -1,6 +1,6 @@ dependencies { api project(':elx-api') implementation libs.time - testImplementation libs.netty.http + testImplementation libs.net.http.netty.client testImplementation libs.es.plugin.transport.netty4 } diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java index e9a0a13..72ba1b6 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractBasicClient.java @@ -68,7 +68,7 @@ public abstract class AbstractBasicClient implements BasicClient { } @Override - public boolean init(Settings settings, String infoString) { + public boolean init(Settings settings, String infoString) throws IOException { if (closed.compareAndSet(false, true)) { this.settings = settings; logger.log(Level.INFO, String.format("Elx: %s on %s %s %s Java: %s %s %s %s ES: %s %s", diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java index 0d057f4..2792b54 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractBulkClient.java @@ -40,7 +40,7 @@ public abstract class AbstractBulkClient extends AbstractBasicClient implements } @Override - public boolean init(Settings settings, String info) { + public boolean init(Settings settings, String info) throws IOException { if (super.init(settings, info)) { bulkProcessor = new DefaultBulkProcessor(this, settings); return true; diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java index 7e62e15..f5b82d7 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractSearchClient.java @@ -42,7 +42,7 @@ public abstract class AbstractSearchClient extends AbstractBasicClient implement } @Override - public boolean init(Settings settings, String info) { + public boolean init(Settings settings, String info) throws IOException { if (super.init(settings, info)) { if (settings.getAsBoolean(Parameters.SEARCH_METRIC_ENABLED.getName(), Parameters.SEARCH_METRIC_ENABLED.getBoolean())) { diff --git a/elx-common/src/main/java/org/xbib/elx/common/DaemonThreadFactory.java b/elx-common/src/main/java/org/xbib/elx/common/DaemonThreadFactory.java index 5e2eb9a..92047e8 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/DaemonThreadFactory.java +++ b/elx-common/src/main/java/org/xbib/elx/common/DaemonThreadFactory.java @@ -13,8 +13,7 @@ public class DaemonThreadFactory implements ThreadFactory { public DaemonThreadFactory(String namePrefix) { this.namePrefix = namePrefix; - SecurityManager s = System.getSecurityManager(); - group = s != null ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); + this.group = Thread.currentThread().getThreadGroup(); } @Override diff --git a/elx-http/build.gradle b/elx-http/build.gradle index 31c0959..127ba7e 100644 --- a/elx-http/build.gradle +++ b/elx-http/build.gradle @@ -1,5 +1,5 @@ dependencies{ api project(':elx-common') - api libs.netty.http + api libs.net.http.netty.client api libs.es.plugin.transport.netty4 } diff --git a/elx-http/src/main/java/org/xbib/elx/http/HttpAction.java b/elx-http/src/main/java/org/xbib/elx/http/HttpAction.java index f3906dc..31397d4 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/HttpAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/HttpAction.java @@ -1,9 +1,5 @@ package org.xbib.elx.http; -import io.netty.buffer.ByteBuf; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpResponseStatus; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -23,9 +19,12 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestStatus; import org.xbib.net.URL; -import org.xbib.netty.http.client.api.ClientTransport; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.HttpHeaderNames; +import org.xbib.net.http.HttpMethod; +import org.xbib.net.http.client.netty.HttpRequest; +import org.xbib.net.http.client.netty.HttpRequestBuilder; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.Interaction; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -57,17 +56,17 @@ public abstract class HttpAction { if (logger.isTraceEnabled()) { - logger.log(Level.TRACE, "got response: " + fullHttpResponse.getStatus().getCode() + + logger.log(Level.TRACE, "got response: " + fullHttpResponse.getStatus().codeAsText() + " headers = " + fullHttpResponse.getHeaders() + - " content = " + fullHttpResponse.getBody().toString(StandardCharsets.UTF_8)); + " content = " + fullHttpResponse.getBodyAsChars(StandardCharsets.UTF_8)); } httpActionContext.setHttpResponse(fullHttpResponse); - if (fullHttpResponse.getStatus().getCode() == HttpResponseStatus.OK.code()) { + if (fullHttpResponse.getStatus().code() == 200) { listener.onResponse(parseToResponse(httpActionContext)); } else { ElasticsearchStatusException statusException = parseToError(httpActionContext); @@ -81,7 +80,7 @@ public abstract class HttpAction httpActionContext) { - String mediaType = httpActionContext.getHttpResponse().getHeaders().getHeader(HttpHeaderNames.CONTENT_TYPE); + String mediaType = httpActionContext.getHttpResponse().getHeaders().get(HttpHeaderNames.CONTENT_TYPE); XContentType xContentType = XContentType.fromMediaTypeOrFormat(mediaType); if (xContentType == null) { throw new IllegalStateException("unsupported content-type: " + mediaType); @@ -161,13 +156,13 @@ public abstract class HttpAction { @Override @@ -26,12 +23,12 @@ public class HttpNodesInfoAction extends HttpAction list = new ArrayList<>(); if (request.metadata()) { list.add("metadata"); diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/alias/HttpIndicesAliasesAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/alias/HttpIndicesAliasesAction.java index 24bb35f..20a41a5 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/alias/HttpIndicesAliasesAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/alias/HttpIndicesAliasesAction.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; import java.io.IOException; @@ -24,7 +24,7 @@ public class HttpIndicesAliasesAction extends HttpAction { @Override - protected Request.Builder createHttpRequest(String url, GetAliasesRequest request) { + protected HttpRequestBuilder createHttpRequest(String url, GetAliasesRequest request) { // beware of this inconsistency, request.indices() always return empty array String index = request.indices() != null ? String.join(",", request.indices()) + "/" : ""; String aliases = request.aliases() != null ? String.join(",", request.aliases()) + "/" : ""; diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/create/HttpCreateIndexAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/create/HttpCreateIndexAction.java index ef7f052..91c4434 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/create/HttpCreateIndexAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/create/HttpCreateIndexAction.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; import java.io.IOException; @@ -23,7 +23,7 @@ public class HttpCreateIndexAction extends HttpAction entityParser(HttpResponse httpResponse) { - return httpResponse.getStatus().getCode() == 200 ? this::found : this::notfound; + return httpResponse.getStatus().code() == 200 ? this::found : this::notfound; } private IndicesExistsResponse found(XContentParser parser) { diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/get/HtppGetIndexAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/get/HtppGetIndexAction.java index f97dd0d..ae52b41 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/get/HtppGetIndexAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/get/HtppGetIndexAction.java @@ -6,8 +6,9 @@ import org.elasticsearch.action.admin.indices.get.GetIndexResponse; import org.elasticsearch.common.CheckedFunction; import org.elasticsearch.common.xcontent.XContentParser; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; + import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -20,7 +21,7 @@ public class HtppGetIndexAction extends HttpAction list = getIndexRequest.indices().length == 0 ? List.of("*") : Arrays.asList(getIndexRequest.indices()); String command = "/" + String.join(",", list); diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/mapping/get/HttpGetMappingsAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/mapping/get/HttpGetMappingsAction.java index 6a69acb..e7d148a 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/mapping/get/HttpGetMappingsAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/admin/indices/mapping/get/HttpGetMappingsAction.java @@ -9,8 +9,9 @@ import org.elasticsearch.common.ParseField; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.xcontent.XContentParser; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; + import java.io.IOException; import java.util.Map; @@ -24,7 +25,7 @@ public class HttpGetMappingsAction extends HttpAction { } @Override - protected Request.Builder createHttpRequest(String url, BulkRequest request) throws IOException { + protected HttpRequestBuilder createHttpRequest(String url, BulkRequest request) throws IOException { StringBuilder bulkContent = new StringBuilder(); for (DocWriteRequest actionRequest : request.requests()) { if (actionRequest instanceof IndexRequest) { diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpExistsAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpExistsAction.java index 4b33932..82d5245 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpExistsAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpExistsAction.java @@ -7,8 +7,8 @@ import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.common.CheckedFunction; import org.elasticsearch.common.xcontent.XContentParser; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; import java.io.IOException; @@ -20,7 +20,7 @@ public class HttpExistsAction extends HttpAction { } @Override - protected Request.Builder createHttpRequest(String url, GetRequest request) { + protected HttpRequestBuilder createHttpRequest(String url, GetRequest request) { return newHeadRequest(url, "/" + request.index() + "/_doc/" + request.id()); } diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpGetAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpGetAction.java index 5d48f97..2ae3646 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpGetAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpGetAction.java @@ -7,8 +7,8 @@ import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.common.CheckedFunction; import org.elasticsearch.common.xcontent.XContentParser; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; import java.io.IOException; @@ -20,7 +20,7 @@ public class HttpGetAction extends HttpAction { } @Override - protected Request.Builder createHttpRequest(String url, GetRequest request) { + protected HttpRequestBuilder createHttpRequest(String url, GetRequest request) { return newGetRequest(url, "/" + request.index() + "/_doc/" + request.id()); } diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpMultiGetAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpMultiGetAction.java index d6a5f69..a6df4a9 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpMultiGetAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/get/HttpMultiGetAction.java @@ -10,8 +10,9 @@ import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; + import java.io.IOException; public class HttpMultiGetAction extends HttpAction { @@ -22,7 +23,7 @@ public class HttpMultiGetAction extends HttpAction { } @Override - protected Request.Builder createHttpRequest(String url, IndexRequest request) { + protected HttpRequestBuilder createHttpRequest(String url, IndexRequest request) { String optype = request.opType() == DocWriteRequest.OpType.CREATE ? "_create" : "_doc"; return newPutRequest(url, "/" + request.index() + "/" + optype + "/" + request.id(), request.source()); diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/main/HttpMainAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/main/HttpMainAction.java index 416eddd..5587bd9 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/main/HttpMainAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/main/HttpMainAction.java @@ -7,8 +7,8 @@ import org.elasticsearch.action.main.MainResponse; import org.elasticsearch.common.CheckedFunction; import org.elasticsearch.common.xcontent.XContentParser; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; import java.io.IOException; @@ -20,7 +20,7 @@ public class HttpMainAction extends HttpAction { } @Override - protected Request.Builder createHttpRequest(String url, MainRequest request) { + protected HttpRequestBuilder createHttpRequest(String url, MainRequest request) { return newGetRequest(url, "/"); } diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/search/HttpClearScrollAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/search/HttpClearScrollAction.java index b7d5f16..f55854e 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/search/HttpClearScrollAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/search/HttpClearScrollAction.java @@ -10,8 +10,9 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; + import java.io.IOException; public class HttpClearScrollAction extends HttpAction { @@ -22,7 +23,7 @@ public class HttpClearScrollAction extends HttpAction } @Override - protected Request.Builder createHttpRequest(String url, SearchRequest request) { + protected HttpRequestBuilder createHttpRequest(String url, SearchRequest request) { Scroll scroll = request.scroll(); String params = scroll != null ? "?scroll=" + scroll.keepAlive() : ""; String index = request.indices() != null ? String.join(",", request.indices()) + "/" : ""; diff --git a/elx-http/src/main/java/org/xbib/elx/http/action/search/HttpSearchScrollAction.java b/elx-http/src/main/java/org/xbib/elx/http/action/search/HttpSearchScrollAction.java index 382cba3..572877f 100644 --- a/elx-http/src/main/java/org/xbib/elx/http/action/search/HttpSearchScrollAction.java +++ b/elx-http/src/main/java/org/xbib/elx/http/action/search/HttpSearchScrollAction.java @@ -10,8 +10,9 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.xbib.elx.http.HttpAction; -import org.xbib.netty.http.client.api.Request; -import org.xbib.netty.http.common.HttpResponse; +import org.xbib.net.http.client.HttpResponse; +import org.xbib.net.http.client.netty.HttpRequestBuilder; + import java.io.IOException; public class HttpSearchScrollAction extends HttpAction { @@ -22,7 +23,7 @@ public class HttpSearchScrollAction extends HttpAction } @Override - protected Request.Builder createHttpRequest(String url, UpdateRequest updateRequest) { + protected HttpRequestBuilder createHttpRequest(String url, UpdateRequest updateRequest) { try { // The Java API allows update requests with different content types // set for the partial document and the upsert document. This client diff --git a/elx-transport/src/main/java/org/xbib/elx/transport/TransportAdminClient.java b/elx-transport/src/main/java/org/xbib/elx/transport/TransportAdminClient.java index 51084cb..79ba6d1 100644 --- a/elx-transport/src/main/java/org/xbib/elx/transport/TransportAdminClient.java +++ b/elx-transport/src/main/java/org/xbib/elx/transport/TransportAdminClient.java @@ -5,6 +5,8 @@ import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.settings.Settings; import org.xbib.elx.common.AbstractAdminClient; +import java.io.IOException; + /** * Transport admin client. */ @@ -23,7 +25,7 @@ public class TransportAdminClient extends AbstractAdminClient { } @Override - public boolean init(Settings settings, String info) { + public boolean init(Settings settings, String info) throws IOException { if (super.init(settings, "Netty: " + io.netty.util.Version.identify())) { helper.init((TransportClient) getClient(), settings); return true; diff --git a/elx-transport/src/main/java/org/xbib/elx/transport/TransportBulkClient.java b/elx-transport/src/main/java/org/xbib/elx/transport/TransportBulkClient.java index 306303d..d6dac9e 100644 --- a/elx-transport/src/main/java/org/xbib/elx/transport/TransportBulkClient.java +++ b/elx-transport/src/main/java/org/xbib/elx/transport/TransportBulkClient.java @@ -5,6 +5,8 @@ import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.settings.Settings; import org.xbib.elx.common.AbstractBulkClient; +import java.io.IOException; + /** * Transport search client with additional methods. */ @@ -23,7 +25,7 @@ public class TransportBulkClient extends AbstractBulkClient { } @Override - public boolean init(Settings settings, String info) { + public boolean init(Settings settings, String info) throws IOException { if (super.init(settings, "Netty: " + io.netty.util.Version.identify())) { helper.init((TransportClient) getClient(), settings); return true; diff --git a/elx-transport/src/main/java/org/xbib/elx/transport/TransportSearchClient.java b/elx-transport/src/main/java/org/xbib/elx/transport/TransportSearchClient.java index aa0d333..d7ece08 100644 --- a/elx-transport/src/main/java/org/xbib/elx/transport/TransportSearchClient.java +++ b/elx-transport/src/main/java/org/xbib/elx/transport/TransportSearchClient.java @@ -5,6 +5,8 @@ import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.settings.Settings; import org.xbib.elx.common.AbstractSearchClient; +import java.io.IOException; + /** * Transport search client with additional methods. */ @@ -23,7 +25,7 @@ public class TransportSearchClient extends AbstractSearchClient { } @Override - public boolean init(Settings settings, String info) { + public boolean init(Settings settings, String info) throws IOException { if (super.init(settings, "Netty: " + io.netty.util.Version.identify())) { helper.init((TransportClient) getClient(), settings); return true; diff --git a/gradle.properties b/gradle.properties index 5da3b5f..ecc8367 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group = org.xbib name = elx -version = 7.10.2.22 +version = 7.10.2.23 org.gradle.warning.mode = ALL diff --git a/gradle/compile/java.gradle b/gradle/compile/java.gradle index e40c92e..4fb980b 100644 --- a/gradle/compile/java.gradle +++ b/gradle/compile/java.gradle @@ -5,13 +5,13 @@ java { } compileJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } compileTestJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } jar { @@ -34,10 +34,11 @@ artifacts { } tasks.withType(JavaCompile) { - // TransportClient is deprecated - options.compilerArgs << '-Xlint:all,-deprecation' + options.compilerArgs.add('-Xlint:all') + options.encoding = 'UTF-8' } -javadoc { +tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') + options.encoding = 'UTF-8' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927..249e583 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 92f06b5..8fad3f5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787..a69d9cb 100755 --- a/gradlew +++ b/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f..53a6b23 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/settings.gradle b/settings.gradle index c14b504..693d6d5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,16 +1,16 @@ dependencyResolutionManagement { versionCatalogs { libs { - version('gradle', '7.5') - version('junit', '5.8.2') + version('gradle', '7.5.1') + version('junit', '5.9.1') version('elasticsearch', '7.10.2') version('lucene', '8.7.0') version('log4j', '2.17.1') // ES 7.10.2 uses log4j2 2.11.1 library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit') library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit') library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit') - library('hamcrest', 'org.hamcrest:hamcrest-library:2.2') - library('junit4', 'junit:junit:4.13.2') + library('hamcrest', 'org.hamcrest', 'hamcrest-library').version('2.2') + library('junit4', 'junit', 'junit').version('4.13.2') library('log4j-api', 'org.apache.logging.log4j', 'log4j-api').versionRef('log4j') library('log4j-core', 'org.apache.logging.log4j', 'log4j-core').versionRef('log4j') library('log4j-slf4j', 'org.apache.logging.log4j', 'log4j-slf4j-impl').versionRef('log4j') @@ -27,9 +27,11 @@ dependencyResolutionManagement { library('joda', 'joda-time', 'joda-time').version('2.10.4') library('tdigest', 'com.tdunning', 't-digest').version('3.2') library('es-plugin-transport-netty4', 'org.elasticsearch.plugin', 'transport-netty4-client').versionRef('elasticsearch') - library('jackson', 'com.fasterxml.jackson.core', 'jackson-core').version('2.12.7') // ES 7.10.2 uses Jackson 2.10.4 - library('netty-http', 'org.xbib', 'netty-http-client').version('4.1.77.0') // ES 7.10.2 uses Netty 4.1.49 - library('metrics', 'org.xbib', 'metrics-common').version('2.2.0') + // ES 7.10.2 uses Jackson 2.10.4 + library('jackson', 'com.fasterxml.jackson.core', 'jackson-core').version('2.12.7') + // ES 7.10.2 uses Netty 4.1.49 + library('net-http-netty-client', 'org.xbib', 'net-http-client-netty').version('3.0.0') + library('metrics', 'org.xbib', 'metrics-common').version('3.0.0') library('time', 'org.xbib', 'time').version('2.1.0') } }