update to 6.3.2.4, update to Gradle 5.1

This commit is contained in:
Jörg Prante 2019-02-10 20:39:07 +01:00
parent db95d266d3
commit 6611a55cba
20 changed files with 110 additions and 82 deletions

View file

@ -7,7 +7,7 @@ dependencies {
exclude group: 'org.elasticsearch.plugin', module: 'percolator-client'
exclude group: 'org.elasticsearch.plugin', module: 'lang-mustache-client'
}
// we try to override the Elasticsearch netty by our netty version which might be more recent
// we try to override the Elasticsearch netty by our netty version which is more recent
compile "io.netty:netty-buffer:${rootProject.property('netty.version')}"
compile "io.netty:netty-codec-http:${rootProject.property('netty.version')}"
compile "io.netty:netty-handler:${rootProject.property('netty.version')}"

View file

@ -1,12 +1,27 @@
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
buildscript {
repositories {
jcenter()
maven {
url 'http://xbib.org/repository'
}
}
dependencies {
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
}
}
plugins {
id "org.sonarqube" version "2.6.1"
id "io.codearte.nexus-staging" version "0.11.0"
id "org.xbib.gradle.plugin.asciidoctor" version "1.6.0.0"
id "org.xbib.gradle.plugin.asciidoctor" version "1.6.0.1"
}
printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" +
printf "Date: %s\nHost: %s\nOS: %s %s %s\nJava: %s %s %s %s\nGradle: %s Groovy: %s Java: %s\n" +
"Build: group: ${project.group} name: ${project.name} version: ${project.version}\n",
ZonedDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME),
InetAddress.getLocalHost(),
System.getProperty("os.name"),
System.getProperty("os.arch"),
@ -15,19 +30,25 @@ printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" +
System.getProperty("java.vm.version"),
System.getProperty("java.vm.vendor"),
System.getProperty("java.vm.name"),
GroovySystem.getVersion(),
gradle.gradleVersion
gradle.gradleVersion, GroovySystem.getVersion(), JavaVersion.current()
apply plugin: "io.codearte.nexus-staging"
apply plugin: 'org.xbib.gradle.plugin.asciidoctor'
ext {
user = 'jprante'
name = 'elx'
description = 'Elasticsearch extensions'
scmUrl = 'https://github.com/' + user + '/' + name
scmConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
scmDeveloperConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
//apply plugin: 'findbugs'
//apply plugin: 'pmd'
//apply plugin: 'checkstyle'
apply plugin: 'org.xbib.gradle.plugin.asciidoctor'
configurations {
wagon
@ -36,36 +57,24 @@ subprojects {
}
dependencies {
//testCompile "junit:junit:${project.property('junit.version')}"
//testCompile "org.apache.logging.log4j:log4j-core:${project.property('log4j.version')}"
alpnagent "org.mortbay.jetty.alpn:jetty-alpn-agent:${project.property('alpnagent.version')}"
asciidoclet "org.xbib:asciidoclet:${project.property('asciidoclet.version')}"
wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}"
}
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.compilerArgs << "-proc:none" << "-Xlint:all,-rawtypes,-unchecked,-try" << "--release" << "8" //<< "-profile" << "compact3"
compileJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
jar {
baseName "${rootProject.name}-${project.name}"
}
asciidoctor {
attributes toc: 'left',
doctype: 'book',
icons: 'font',
encoding: 'utf-8',
sectlink: true,
sectanchors: true,
linkattrs: true,
imagesdir: 'img',
'source-highlighter': 'coderay'
}
javadoc {
options.docletpath = configurations.asciidoclet.files.asType(List)
options.doclet = 'org.xbib.asciidoclet.Asciidoclet'
@ -108,6 +117,18 @@ subprojects {
}
/*asciidoctor {
attributes toc: 'left',
doctype: 'book',
icons: 'font',
encoding: 'utf-8',
sectlink: true,
sectanchors: true,
linkattrs: true,
imagesdir: 'img',
'source-highlighter': 'coderay'
}*/
/*
task aggregatedJavadoc(type: Javadoc) {
group = 'aggregation'

View file

@ -6,7 +6,7 @@ buildscript {
}
}
dependencies {
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.2.2.0"
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
}
}
@ -21,18 +21,20 @@ dependencies {
compile project(':api')
compile "org.xbib:metrics:${project.property('xbib-metrics.version')}"
compileOnly "org.apache.logging.log4j:log4j-api:${project.property('log4j.version')}"
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
}
jar {
baseName "${rootProject.name}-common"
}
/*
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "${project.archivesBaseName}-tests"
from sourceSets.test.output
}
*/
artifacts {
main jar
@ -56,7 +58,7 @@ randomizedTest {
esTest {
// test with the jars, not the classes, for security manager
classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
// classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
systemProperty 'tests.security.manager', 'true'
}
esTest.dependsOn jar, testJar

View file

@ -1,28 +1,30 @@
org.gradle.daemon=false
org.gradle.warning.mode=all
group = org.xbib.elasticsearch
name = elasticsearch-client-netty
version = 6.2.2.0
name = elasticsearch-client
version = 6.3.2.0
profile = default
release = 0
elasticsearch.version = 6.2.2
netty.version = 4.1.24.Final
tcnative.version = 2.0.7.Final
elasticsearch.version = 6.3.2
lucene.version = 7.3.1
netty.version = 4.1.29.Final
tcnative.version = 2.0.15.Final
alpnagent.version = 2.0.7
#xbib-netty-http-client.version = 4.1.16.1
xbib-netty-http-client.version = 4.1.24.0
xbib-netty-http-client.version = 4.1.29.0
xbib-metrics.version = 1.1.0
# elasticsearch build plugin
xbib-elasticsearch-test.version = 6.2.2.0
lucene.version = 7.2.1
spatial4j.version = 0.6
jts.version = 1.13
jna.version = 4.5.1
elasticsearch-libs.version = 6.3.2.1
elasticsearch-devkit.version = 6.3.2.4
spatial4j.version = 0.7
jts.version = 1.15.1
jna.version = 4.5.2
log4j.version = 2.11.1
checkstyle.version = 8.13
# test
log4j.version = 2.9.1
junit.version = 4.12
wagon.version = 3.0.0
asciidoclet.version = 1.6.0.0
org.gradle.warning.mode=all

View file

@ -1,8 +0,0 @@
ext {
user = 'xbib'
name = 'elasticsearch-java-client'
description = 'Netty Java client for Elasticsearch'
scmUrl = 'https://github.com/' + user + '/' + name
scmConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
scmDeveloperConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
}

Binary file not shown.

View file

@ -1,6 +1,5 @@
#Fri May 04 14:40:54 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip

2
gradlew vendored
View file

@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

2
gradlew.bat vendored
View file

@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

View file

@ -6,7 +6,7 @@ buildscript {
}
}
dependencies {
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.2.2.0"
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
}
}
@ -20,18 +20,20 @@ configurations {
dependencies {
compile project(':common')
compile "org.xbib:netty-http-client:${project.property('xbib-netty-http-client.version')}"
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
}
jar {
baseName "${rootProject.name}-common"
}
/*
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "${project.archivesBaseName}-tests"
from sourceSets.test.output
}
*/
artifacts {
main jar
@ -55,7 +57,7 @@ randomizedTest {
esTest {
enabled = true
// test with the jars, not the classes, for security manager
classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
// classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
systemProperty 'tests.security.manager', 'true'
// maybe we like some extra security policy for our code
systemProperty 'tests.security.policy', '/extra-security.policy'

View file

@ -119,7 +119,10 @@ public class HttpNodesInfoAction extends HttpAction<NodesInfoRequest, NodesInfoR
try {
InetAddress[] inetAddresses = InetAddress.getAllByName(host);
TransportAddress transportAddress = new TransportAddress(inetAddresses[0], port);
Build build = new Build((String) map2.get("build"), (String)map2.get("date"), (Boolean)map2.get("snapshst"));
Build build = new Build(Build.Flavor.OSS, Build.Type.TAR,
(String) map2.get("build"),
(String)map2.get("date"),
(Boolean)map2.get("snapshot"));
Map<String, String> attributes = Collections.emptyMap();
Set<DiscoveryNode.Role> roles = new HashSet<>();
Version version = Version.fromString((String) map2.get("version"));

View file

@ -1,6 +1,7 @@
package org.elasticsearch.action.admin.cluster.settings;
import org.elasticsearch.common.CheckedFunction;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
@ -32,7 +33,7 @@ public class HttpClusterUpdateSettingsAction extends HttpAction<ClusterUpdateSet
builder.startObject("transient");
request.transientSettings().toXContent(builder, ToXContent.EMPTY_PARAMS);
builder.endObject().endObject();
return newPutRequest(url, "/_cluster/settings", builder.bytes());
return newPutRequest(url, "/_cluster/settings", BytesReference.bytes(builder));
} catch (IOException e) {
throw new UncheckedIOException(e);
}

View file

@ -1,12 +1,12 @@
package org.elasticsearch.action.admin.indices.create;
import org.elasticsearch.common.CheckedFunction;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.xbib.elasticsearch.client.http.HttpAction;
import org.xbib.netty.http.client.Request;
import org.xbib.netty.http.client.RequestBuilder;
import java.io.IOException;
@ -22,7 +22,7 @@ public class HttpCreateIndexAction extends HttpAction<CreateIndexRequest, Create
protected RequestBuilder createHttpRequest(String url, CreateIndexRequest createIndexRequest) throws IOException {
XContentBuilder builder = XContentFactory.jsonBuilder();
builder = createIndexRequest.toXContent(builder, ToXContent.EMPTY_PARAMS);
return newPutRequest(url, "/" + createIndexRequest.index(), builder.bytes());
return newPutRequest(url, "/" + createIndexRequest.index(), BytesReference.bytes(builder));
}
@Override

View file

@ -1,6 +1,7 @@
package org.elasticsearch.action.admin.indices.settings.put;
import org.elasticsearch.common.CheckedFunction;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
@ -30,7 +31,7 @@ public class HttpUpdateSettingsAction extends HttpAction<UpdateSettingsRequest,
request.settings().toXContent(builder, ToXContent.EMPTY_PARAMS);
builder.endObject();
String index = request.indices() != null ? "/" + String.join(",", request.indices()) : "";
return newPutRequest(url, index + "/_settings", builder.bytes());
return newPutRequest(url, index + "/_settings", BytesReference.bytes(builder));
} catch (IOException e) {
throw new UncheckedIOException(e);
}

View file

@ -13,6 +13,7 @@ import org.elasticsearch.action.GenericAction;
import org.elasticsearch.common.CheckedFunction;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.DeprecationHandler;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType;
import org.xbib.netty.http.client.Request;
@ -143,6 +144,7 @@ public abstract class HttpAction<R extends ActionRequest, T extends ActionRespon
throw new IllegalStateException("unsupported content-type: " + mediaType);
}
try (XContentParser parser = xContentType.xContent().createParser(httpActionContext.getHttpClient().getRegistry(),
DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
httpActionContext.getHttpResponse().content().array())) {
return entityParser().apply(parser);
} catch (IOException e) {

View file

@ -6,7 +6,7 @@ buildscript {
}
}
dependencies {
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.2.2.0"
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
}
}
@ -19,18 +19,20 @@ configurations {
dependencies {
compile project(':common')
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
}
jar {
baseName "${rootProject.name}-node"
}
/*
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "${project.archivesBaseName}-tests"
from sourceSets.test.output
}
*/
artifacts {
main jar
@ -55,7 +57,7 @@ randomizedTest {
esTest {
// test with the jars, not the classes, for security manager
classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
// classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
systemProperty 'tests.security.manager', 'true'
// maybe we like some extra security policy for our code
systemProperty 'tests.security.policy', '/extra-security.policy'

View file

@ -1,4 +1,3 @@
include 'api'
include 'common'
include 'node'

View file

@ -6,7 +6,7 @@ buildscript {
}
}
dependencies {
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.2.2.0"
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
}
}
@ -19,18 +19,20 @@ configurations {
dependencies {
compile project(':common')
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
}
jar {
baseName "${rootProject.name}-transport"
}
/*
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "${project.archivesBaseName}-tests"
from sourceSets.test.output
}
*/
artifacts {
main jar
@ -41,7 +43,7 @@ artifacts {
esTest {
enabled = true
// test with the jars, not the classes, for security manager
classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
//classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
systemProperty 'tests.security.manager', 'true'
// maybe we like some extra security policy for our code
systemProperty 'tests.security.policy', '/extra-security.policy'

View file

@ -1,6 +1,6 @@
package org.xbib.elasticsearch.client.transport;
import org.elasticsearch.common.inject.internal.Nullable;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.transport.TransportRequestOptions;

View file

@ -43,7 +43,7 @@ public final class RemoteConnectionInfo implements ToXContentFragment, Writeable
seedNodes = input.readList(TransportAddress::new);
httpAddresses = input.readList(TransportAddress::new);
connectionsPerCluster = input.readVInt();
initialConnectionTimeout = new TimeValue(input);
initialConnectionTimeout = input.readTimeValue();
numNodesConnected = input.readVInt();
clusterAlias = input.readString();
if (input.getVersion().onOrAfter(Version.V_6_1_0)) {
@ -82,7 +82,7 @@ public final class RemoteConnectionInfo implements ToXContentFragment, Writeable
out.writeList(seedNodes);
out.writeList(httpAddresses);
out.writeVInt(connectionsPerCluster);
initialConnectionTimeout.writeTo(out);
out.writeTimeValue(initialConnectionTimeout);
out.writeVInt(numNodesConnected);
out.writeString(clusterAlias);
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {