From b012e0221565b049b1455c56e286ead71ccf44ce Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 2 Apr 2019 17:44:13 -0400 Subject: [PATCH 01/14] Bump the minimum Java version to Java 11 With the 8.0.0 release of Elasticsearch we will bump the minimum required Java to Java 11. This commit puts this into effect on the master branch. --- .../src/main/resources/minimumCompilerVersion | 2 +- .../src/main/resources/minimumRuntimeVersion | 2 +- .../java_version_checker/JavaVersion.java | 2 +- .../JavaVersionChecker.java | 4 +- libs/core/build.gradle | 43 -------------- .../core/internal/io/Streams.java | 26 +++------ .../core/internal/io/Streams.java | 57 ------------------- server/build.gradle | 28 ++++----- .../elasticsearch/monitor/jvm/JvmInfo.java | 27 +++++++-- .../org/elasticsearch/monitor/jvm/JvmPid.java | 49 ---------------- .../org/elasticsearch/monitor/jvm/JvmPid.java | 28 --------- test/logger-usage/build.gradle | 4 +- .../loggerusage/ESLoggerUsageChecker.java | 12 +++- 13 files changed, 65 insertions(+), 219 deletions(-) delete mode 100644 libs/core/src/main/java9/org/elasticsearch/core/internal/io/Streams.java delete mode 100644 server/src/main/java/org/elasticsearch/monitor/jvm/JvmPid.java delete mode 100644 server/src/main/java9/org/elasticsearch/monitor/jvm/JvmPid.java diff --git a/buildSrc/src/main/resources/minimumCompilerVersion b/buildSrc/src/main/resources/minimumCompilerVersion index 35d51f33b34f9..3cacc0b93c9c9 100644 --- a/buildSrc/src/main/resources/minimumCompilerVersion +++ b/buildSrc/src/main/resources/minimumCompilerVersion @@ -1 +1 @@ -1.12 \ No newline at end of file +12 \ No newline at end of file diff --git a/buildSrc/src/main/resources/minimumRuntimeVersion b/buildSrc/src/main/resources/minimumRuntimeVersion index 468437494697b..9d607966b721a 100644 --- a/buildSrc/src/main/resources/minimumRuntimeVersion +++ b/buildSrc/src/main/resources/minimumRuntimeVersion @@ -1 +1 @@ -1.8 \ No newline at end of file +11 \ No newline at end of file diff --git a/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersion.java b/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersion.java index a06579d84254a..ca375c501c4ff 100644 --- a/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersion.java +++ b/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersion.java @@ -26,7 +26,7 @@ public class JavaVersion { public static final List CURRENT = parse(System.getProperty("java.specification.version")); - public static final List JAVA_8 = parse("1.8"); + public static final List JAVA_11 = parse("11"); static List parse(final String value) { if (!value.matches("^0*[0-9]+(\\.[0-9]+)*$")) { diff --git a/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersionChecker.java b/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersionChecker.java index b61c5856084ff..da270bd67e2e8 100644 --- a/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersionChecker.java +++ b/distribution/tools/java-version-checker/src/main/java/org/elasticsearch/tools/java_version_checker/JavaVersionChecker.java @@ -40,10 +40,10 @@ public static void main(final String[] args) { if (args.length != 0) { throw new IllegalArgumentException("expected zero arguments but was " + Arrays.toString(args)); } - if (JavaVersion.compare(JavaVersion.CURRENT, JavaVersion.JAVA_8) < 0) { + if (JavaVersion.compare(JavaVersion.CURRENT, JavaVersion.JAVA_11) < 0) { final String message = String.format( Locale.ROOT, - "the minimum required Java version is 8; your Java version from [%s] does not meet this requirement", + "the minimum required Java version is 11; your Java version from [%s] does not meet this requirement", System.getProperty("java.home")); errPrintln(message); exit(1); diff --git a/libs/core/build.gradle b/libs/core/build.gradle index 1f218f546ffd8..c6abf288230b5 100644 --- a/libs/core/build.gradle +++ b/libs/core/build.gradle @@ -23,45 +23,6 @@ apply plugin: 'nebula.maven-scm' archivesBaseName = 'elasticsearch-core' -// we want to keep the JDKs in our IDEs set to JDK 8 until minimum JDK is bumped to 9 so we do not include this source set in our IDEs -if (!isEclipse && !isIdea) { - sourceSets { - java9 { - java { - srcDirs = ['src/main/java9'] - } - } - } - - configurations { - java9Compile.extendsFrom(compile) - } - - dependencies { - java9Compile sourceSets.main.output - } - - compileJava9Java { - sourceCompatibility = 9 - targetCompatibility = 9 - } - - forbiddenApisJava9 { - if (project.runtimeJavaVersion < JavaVersion.VERSION_1_9) { - targetCompatibility = JavaVersion.VERSION_1_9.getMajorVersion() - } - replaceSignatureFiles 'jdk-signatures' - } - - jar { - metaInf { - into 'versions/9' - from sourceSets.java9.output - } - manifest.attributes('Multi-Release': 'true') - } -} - publishing { publications { nebula { @@ -75,10 +36,6 @@ dependencies { testCompile "junit:junit:${versions.junit}" testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}" - if (!isEclipse && !isIdea) { - java9Compile sourceSets.main.output - } - if (isEclipse == false || project.path == ":libs:core-tests") { testCompile("org.elasticsearch.test:framework:${version}") { exclude group: 'org.elasticsearch', module: 'elasticsearch-core' diff --git a/libs/core/src/main/java/org/elasticsearch/core/internal/io/Streams.java b/libs/core/src/main/java/org/elasticsearch/core/internal/io/Streams.java index a006028b90556..8523609c28425 100644 --- a/libs/core/src/main/java/org/elasticsearch/core/internal/io/Streams.java +++ b/libs/core/src/main/java/org/elasticsearch/core/internal/io/Streams.java @@ -22,21 +22,20 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.Objects; /** - * Simple utility methods for file and stream copying. - * All copy methods use a block size of 4096 bytes, - * and close all affected streams when done. + * Simple utility methods for file and stream copying. All copy methods close all affected streams when done. *

- * Mainly for use within the framework, - * but also useful for application code. + * Mainly for use within the framework, but also useful for application code. */ public class Streams { + private Streams() { + + } + /** - * Copy the contents of the given InputStream to the given OutputStream. - * Closes both streams when done. + * Copy the contents of the given InputStream to the given OutputStream. Closes both streams when done. * * @param in the stream to copy from * @param out the stream to copy to @@ -44,17 +43,9 @@ public class Streams { * @throws IOException in case of I/O errors */ public static long copy(final InputStream in, final OutputStream out) throws IOException { - Objects.requireNonNull(in, "No InputStream specified"); - Objects.requireNonNull(out, "No OutputStream specified"); - final byte[] buffer = new byte[8192]; Exception err = null; try { - long byteCount = 0; - int bytesRead; - while ((bytesRead = in.read(buffer)) != -1) { - out.write(buffer, 0, bytesRead); - byteCount += bytesRead; - } + final long byteCount = in.transferTo(out); out.flush(); return byteCount; } catch (IOException | RuntimeException e) { @@ -64,4 +55,5 @@ public static long copy(final InputStream in, final OutputStream out) throws IOE IOUtils.close(err, in, out); } } + } diff --git a/libs/core/src/main/java9/org/elasticsearch/core/internal/io/Streams.java b/libs/core/src/main/java9/org/elasticsearch/core/internal/io/Streams.java deleted file mode 100644 index 34b3785765d87..0000000000000 --- a/libs/core/src/main/java9/org/elasticsearch/core/internal/io/Streams.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch 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 org.elasticsearch.core.internal.io; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * Simple utility methods for file and stream copying. - * All copy methods close all affected streams when done. - *

- * Mainly for use within the framework, - * but also useful for application code. - */ -public abstract class Streams { - - /** - * Copy the contents of the given InputStream to the given OutputStream. - * Closes both streams when done. - * - * @param in the stream to copy from - * @param out the stream to copy to - * @return the number of bytes copied - * @throws IOException in case of I/O errors - */ - public static long copy(final InputStream in, final OutputStream out) throws IOException { - Exception err = null; - try { - final long byteCount = in.transferTo(out); - out.flush(); - return byteCount; - } catch (IOException | RuntimeException e) { - err = e; - throw e; - } finally { - IOUtils.close(err, in, out); - } - } -} diff --git a/server/build.gradle b/server/build.gradle index 4fc8c451c9b96..bedf3452e3eba 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -34,39 +34,39 @@ publishing { archivesBaseName = 'elasticsearch' -// we want to keep the JDKs in our IDEs set to JDK 8 until minimum JDK is bumped to 9 so we do not include this source set in our IDEs +// we want to keep the JDKs in our IDEs set to JDK 11 until minimum JDK is bumped to 17 so we do not include this source set in our IDEs if (!isEclipse && !isIdea) { sourceSets { - java9 { + java12 { java { - srcDirs = ['src/main/java9'] + srcDirs = ['src/main/java12'] } } } configurations { - java9Compile.extendsFrom(compile) + java12Compile.extendsFrom(compile) } dependencies { - java9Compile sourceSets.main.output + java12Compile sourceSets.main.output } - compileJava9Java { - sourceCompatibility = 9 - targetCompatibility = 9 + compileJava12Java { + sourceCompatibility = 12 + targetCompatibility = 12 } - forbiddenApisJava9 { - if (project.runtimeJavaVersion < JavaVersion.VERSION_1_9) { - targetCompatibility = JavaVersion.VERSION_1_9.getMajorVersion() + forbiddenApisJava12 { + if (project.runtimeJavaVersion < JavaVersion.VERSION_12) { + targetCompatibility = JavaVersion.VERSION_12.getMajorVersion() } } jar { metaInf { - into 'versions/9' - from sourceSets.java9.output + into 'versions/12' + from sourceSets.java12.output } manifest.attributes('Multi-Release': 'true') } @@ -125,7 +125,7 @@ dependencies { compile "org.elasticsearch:jna:${versions.jna}" if (!isEclipse && !isIdea) { - java9Compile sourceSets.main.output + java12Compile sourceSets.main.output } if (isEclipse == false || project.path == ":server-tests") { diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java index b8eda3303377d..6e2bb37b19757 100644 --- a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java @@ -158,10 +158,29 @@ public class JvmInfo implements Writeable, ToXContentFragment { final boolean bundledJdk = Booleans.parseBoolean(System.getProperty("es.bundled_jdk", Boolean.FALSE.toString())); final Boolean usingBundledJdk = bundledJdk ? usingBundledJdk() : null; - INSTANCE = new JvmInfo(JvmPid.getPid(), System.getProperty("java.version"), runtimeMXBean.getVmName(), runtimeMXBean.getVmVersion(), - runtimeMXBean.getVmVendor(), bundledJdk, usingBundledJdk, runtimeMXBean.getStartTime(), configuredInitialHeapSize, - configuredMaxHeapSize, mem, inputArguments, bootClassPath, classPath, systemProperties, gcCollectors, memoryPools, onError, - onOutOfMemoryError, useCompressedOops, useG1GC, useSerialGC); + INSTANCE = new JvmInfo( + ProcessHandle.current().pid(), + System.getProperty("java.version"), + runtimeMXBean.getVmName(), + runtimeMXBean.getVmVersion(), + runtimeMXBean.getVmVendor(), + bundledJdk, + usingBundledJdk, + runtimeMXBean.getStartTime(), + configuredInitialHeapSize, + configuredMaxHeapSize, + mem, + inputArguments, + bootClassPath, + classPath, + systemProperties, + gcCollectors, + memoryPools, + onError, + onOutOfMemoryError, + useCompressedOops, + useG1GC, + useSerialGC); } @SuppressForbidden(reason = "PathUtils#get") diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmPid.java b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmPid.java deleted file mode 100644 index 71472069069b8..0000000000000 --- a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmPid.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch 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 org.elasticsearch.monitor.jvm; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.message.ParameterizedMessage; - -import java.lang.management.ManagementFactory; - -class JvmPid { - - private static final long PID; - - static long getPid() { - return PID; - } - - static { - PID = initializePid(); - } - - private static long initializePid() { - final String name = ManagementFactory.getRuntimeMXBean().getName(); - try { - return Long.parseLong(name.split("@")[0]); - } catch (final NumberFormatException e) { - LogManager.getLogger(JvmPid.class).debug(new ParameterizedMessage("failed parsing PID from [{}]", name), e); - return -1; - } - } - -} diff --git a/server/src/main/java9/org/elasticsearch/monitor/jvm/JvmPid.java b/server/src/main/java9/org/elasticsearch/monitor/jvm/JvmPid.java deleted file mode 100644 index c19a14d836422..0000000000000 --- a/server/src/main/java9/org/elasticsearch/monitor/jvm/JvmPid.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch 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 org.elasticsearch.monitor.jvm; - -class JvmPid { - - static long getPid() { - return ProcessHandle.current().pid(); - } - -} diff --git a/test/logger-usage/build.gradle b/test/logger-usage/build.gradle index 8e374d2cf6af7..80cb060167114 100644 --- a/test/logger-usage/build.gradle +++ b/test/logger-usage/build.gradle @@ -18,7 +18,9 @@ */ dependencies { - compile 'org.ow2.asm:asm-debug-all:5.0.4' // use asm-debug-all as asm-all is broken + compile 'org.ow2.asm:asm:7.1' + compile 'org.ow2.asm:asm-tree:7.1' + compile 'org.ow2.asm:asm-analysis:7.1' compile "org.apache.logging.log4j:log4j-api:${versions.log4j}" testCompile "org.elasticsearch.test:framework:${version}" } diff --git a/test/logger-usage/src/main/java/org/elasticsearch/test/loggerusage/ESLoggerUsageChecker.java b/test/logger-usage/src/main/java/org/elasticsearch/test/loggerusage/ESLoggerUsageChecker.java index 4ee2e473890e2..b8404ea76b6a2 100644 --- a/test/logger-usage/src/main/java/org/elasticsearch/test/loggerusage/ESLoggerUsageChecker.java +++ b/test/logger-usage/src/main/java/org/elasticsearch/test/loggerusage/ESLoggerUsageChecker.java @@ -177,7 +177,7 @@ private static class ClassChecker extends ClassVisitor { private final Predicate methodsToCheck; ClassChecker(Consumer wrongUsageCallback, Predicate methodsToCheck) { - super(Opcodes.ASM5); + super(Opcodes.ASM7); this.wrongUsageCallback = wrongUsageCallback; this.methodsToCheck = methodsToCheck; } @@ -480,6 +480,11 @@ private static final class IntegerConstantBasicValue extends IntMinMaxTrackingBa } private static final class PlaceHolderStringInterpreter extends BasicInterpreter { + + PlaceHolderStringInterpreter() { + super(Opcodes.ASM7); + } + @Override public BasicValue newOperation(AbstractInsnNode insnNode) throws AnalyzerException { if (insnNode.getOpcode() == Opcodes.LDC) { @@ -504,6 +509,11 @@ public BasicValue merge(BasicValue value1, BasicValue value2) { } private static final class ArraySizeInterpreter extends BasicInterpreter { + + ArraySizeInterpreter() { + super(Opcodes.ASM7); + } + @Override public BasicValue newOperation(AbstractInsnNode insnNode) throws AnalyzerException { switch (insnNode.getOpcode()) { From 64a31b1a6debfbc4fc20b52b4e8aca3b4d6c3d85 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 2 Apr 2019 17:48:15 -0400 Subject: [PATCH 02/14] Add breaking change --- docs/reference/migration/migrate_8_0.asciidoc | 2 ++ .../reference/migration/migrate_8_0/packaging.asciidoc | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 docs/reference/migration/migrate_8_0/packaging.asciidoc diff --git a/docs/reference/migration/migrate_8_0.asciidoc b/docs/reference/migration/migrate_8_0.asciidoc index 0c695a3b2bb47..cadc27fe69e06 100644 --- a/docs/reference/migration/migrate_8_0.asciidoc +++ b/docs/reference/migration/migrate_8_0.asciidoc @@ -14,6 +14,7 @@ coming[8.0.0] * <> * <> * <> +* <> * <> * <> @@ -41,5 +42,6 @@ Elasticsearch 7.x in order to be readable by Elasticsearch 8.x. include::migrate_8_0/analysis.asciidoc[] include::migrate_8_0/discovery.asciidoc[] include::migrate_8_0/mappings.asciidoc[] +include::migrate_8_0/packaging.asciidoc[] include::migrate_8_0/snapshots.asciidoc[] include::migrate_8_0/security.asciidoc[] diff --git a/docs/reference/migration/migrate_8_0/packaging.asciidoc b/docs/reference/migration/migrate_8_0/packaging.asciidoc new file mode 100644 index 0000000000000..09d6e57197464 --- /dev/null +++ b/docs/reference/migration/migrate_8_0/packaging.asciidoc @@ -0,0 +1,10 @@ +[float] +[[breaking_80_packaging_changes]] +=== Packaging changes + +[float] +//tag::notable-breaking-changes[] +==== Java 11 is required + +Java 11 is now required to run Elasticsearch and any of its command line tools. +//end::notable-breaking-changes[] From 4679b6107ea00becc4bf0b8197ac19d96f3d287c Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 2 Apr 2019 18:09:14 -0400 Subject: [PATCH 03/14] CI versions --- .ci/java-versions.properties | 2 +- .ci/matrix-runtime-javas.yml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index df205e4868caa..e40470bf51b89 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -5,6 +5,6 @@ # are 'java' or 'openjdk' followed by the major release number. ES_BUILD_JAVA=openjdk12 -ES_RUNTIME_JAVA=java8 +ES_RUNTIME_JAVA=java11 GRADLE_TASK=build diff --git a/.ci/matrix-runtime-javas.yml b/.ci/matrix-runtime-javas.yml index 3545103f191c6..78db05ba3e9bf 100644 --- a/.ci/matrix-runtime-javas.yml +++ b/.ci/matrix-runtime-javas.yml @@ -6,11 +6,8 @@ # or 'openjdk' followed by the major release number. ES_RUNTIME_JAVA: - - java8 - - java8fips - java11 - java12 - openjdk12 - - zulu8 - zulu11 - zulu12 From f4a7816dc1fe6e8b4c8459c1d8fa3189413a2d26 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 2 Apr 2019 19:22:10 -0400 Subject: [PATCH 04/14] Update shadow for new JDK --- buildSrc/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 9d25532d4cef1..93b82090e168a 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -123,7 +123,7 @@ dependencies { compile 'com.perforce:p4java:2012.3.551082' // THIS IS SUPPOSED TO BE OPTIONAL IN THE FUTURE.... compile 'org.apache.rat:apache-rat:0.11' compile "org.elasticsearch:jna:4.5.1" - compile 'com.github.jengelman.gradle.plugins:shadow:2.0.4' + compile 'com.github.jengelman.gradle.plugins:shadow:4.0.3' compile 'de.thetaphi:forbiddenapis:2.6' compile 'com.avast.gradle:gradle-docker-compose-plugin:0.8.12' testCompile "junit:junit:${props.getProperty('junit')}" From b37935ef5143ac05bda1cf7fb6575a84a2573421 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 2 Apr 2019 22:09:25 -0400 Subject: [PATCH 05/14] Temporaily provision JDK 11 in packaging tests --- Vagrantfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 4fbf1beeb04e9..c6e0fef322890 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -246,6 +246,10 @@ def linux_common(config, touch /is_vagrant_vm # for consistency between linux and windows SHELL + config.vm.provision 'jdk-11', type: 'shell', inline: <<-SHELL + curl -sSL https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz | tar xz -C /opt/ + SHELL + # This prevents leftovers from previous tests using the # same VM from messing up the current test config.vm.provision 'clean es installs in tmp', run: 'always', type: 'shell', inline: <<-SHELL @@ -342,10 +346,11 @@ def sh_install_deps(config, } cat \<\ /etc/profile.d/java_home.sh if [ -z "\\\$JAVA_HOME" ]; then - export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java)))) + export JAVA_HOME=/opt/jdk-11.0.2 fi export SYSTEM_JAVA_HOME=\\\$JAVA_HOME unset JAVA_HOME +export PATH=/opt/jdk-11.0.2/bin:\\\$PATH JAVA ensure tar ensure curl From 2842b9b9bbde283bc65810a9b784479f889e66f2 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 6 Apr 2019 10:23:57 -0400 Subject: [PATCH 06/14] Fix docs to say 11 or higher --- docs/reference/migration/migrate_8_0/packaging.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/reference/migration/migrate_8_0/packaging.asciidoc b/docs/reference/migration/migrate_8_0/packaging.asciidoc index 09d6e57197464..aaabfa0f1f4c4 100644 --- a/docs/reference/migration/migrate_8_0/packaging.asciidoc +++ b/docs/reference/migration/migrate_8_0/packaging.asciidoc @@ -6,5 +6,6 @@ //tag::notable-breaking-changes[] ==== Java 11 is required -Java 11 is now required to run Elasticsearch and any of its command line tools. +Java 11 or higher is now required to run Elasticsearch and any of its command +line tools. //end::notable-breaking-changes[] From 795cbc646d749ea0059f30ab0ab274d5742afd90 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 6 Apr 2019 10:28:26 -0400 Subject: [PATCH 07/14] Remove unnecessary setting of the path --- Vagrantfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index c6e0fef322890..6ba1d095e40c4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -350,7 +350,6 @@ if [ -z "\\\$JAVA_HOME" ]; then fi export SYSTEM_JAVA_HOME=\\\$JAVA_HOME unset JAVA_HOME -export PATH=/opt/jdk-11.0.2/bin:\\\$PATH JAVA ensure tar ensure curl From 845d9ab5f587852f4cd09d9994040847997908a7 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 6 Apr 2019 13:49:28 -0400 Subject: [PATCH 08/14] Remove use of Java on path in packaging tests --- .../resources/packaging/tests/module_and_plugin_test_cases.bash | 2 +- qa/vagrant/src/test/resources/packaging/utils/utils.bash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash b/qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash index 8cf5d0cc349ef..6527c69dd74d1 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash +++ b/qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash @@ -430,7 +430,7 @@ fi local java_home=$JAVA_HOME # create a JAVA_HOME with a space - local java=$(which java) + local java="$SYSTEM_JAVA_HOME"/bin/java local temp=`mktemp -d --suffix="java home"` mkdir -p "$temp/bin" ln -s "$java" "$temp/bin/java" diff --git a/qa/vagrant/src/test/resources/packaging/utils/utils.bash b/qa/vagrant/src/test/resources/packaging/utils/utils.bash index 3f577668bf1ec..7645bb9ca6a8f 100644 --- a/qa/vagrant/src/test/resources/packaging/utils/utils.bash +++ b/qa/vagrant/src/test/resources/packaging/utils/utils.bash @@ -67,7 +67,7 @@ if [ ! -x "`which unzip 2>/dev/null`" ]; then exit 1 fi -if [ ! -x "`which java 2>/dev/null`" ]; then +if [ ! -x "`"$SYSTEM_JAVA_HOME"/bin/java 2>/dev/null`" ]; then # there are some tests that move java temporarily if [ ! -x "`command -v java.bak 2>/dev/null`" ]; then echo "'java' command is mandatory to run the tests" From ecfcf7a01e5855caa3e27c0c75c029dd1f471ab8 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 6 Apr 2019 13:57:24 -0400 Subject: [PATCH 09/14] Bump docs version --- docs/Versions.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Versions.asciidoc b/docs/Versions.asciidoc index 75a9784c4822c..bbd001b252e0d 100644 --- a/docs/Versions.asciidoc +++ b/docs/Versions.asciidoc @@ -4,8 +4,8 @@ :lucene_version: 8.0.0 :lucene_version_path: 8_0_0 :branch: master -:jdk: 1.8.0_131 -:jdk_major: 8 +:jdk: 11.0.2 +:jdk_major: 11 :build_flavor: default :build_type: tar From c932ca7839cf61069c8fe3306efd915cfb15556c Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 6 Apr 2019 14:11:14 -0400 Subject: [PATCH 10/14] Simplifications --- buildSrc/build.gradle | 8 -- .../elasticsearch/gradle/BuildPlugin.groovy | 17 +-- .../gradle/precommit/PrecommitTasks.groovy | 3 +- plugins/discovery-azure-classic/build.gradle | 126 ++---------------- plugins/discovery-ec2/build.gradle | 10 +- plugins/repository-hdfs/build.gradle | 9 -- plugins/repository-s3/build.gradle | 109 +-------------- server/build.gradle | 4 +- x-pack/plugin/security/build.gradle | 29 ++-- x-pack/plugin/watcher/build.gradle | 42 ------ 10 files changed, 31 insertions(+), 326 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 93b82090e168a..89fc6c14c3459 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -199,14 +199,6 @@ if (project != rootProject) { into localDownloads } - unitTest { - // The test task is configured to runtimeJava version, but build-tools doesn't support all of them, so test - // with compiler instead on the ones that are too old. - if (project.runtimeJavaVersion <= JavaVersion.VERSION_1_10) { - jvm = "${project.compilerJavaHome}/bin/java" - } - } - // This can't be an RandomizedTestingTask because we can't yet reference it task integTest(type: Test) { // integration test requires the local testing repo for example plugin builds diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 4bd740dde5106..cfa9aabac4824 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -722,11 +722,7 @@ class BuildPlugin implements Plugin { /** Adds compiler settings to the project */ static void configureCompile(Project project) { - if (project.compilerJavaVersion < JavaVersion.VERSION_1_10) { - project.ext.compactProfile = 'compact3' - } else { - project.ext.compactProfile = 'full' - } + project.ext.compactProfile = 'full' project.afterEvaluate { project.tasks.withType(JavaCompile) { final JavaVersion targetCompatibilityVersion = JavaVersion.toVersion(it.targetCompatibility) @@ -738,13 +734,6 @@ class BuildPlugin implements Plugin { options.fork = true options.forkOptions.javaHome = compilerJavaHomeFile } - if (targetCompatibilityVersion == JavaVersion.VERSION_1_8) { - // compile with compact 3 profile by default - // NOTE: this is just a compile time check: does not replace testing with a compact3 JRE - if (project.compactProfile != 'full') { - options.compilerArgs << '-profile' << project.compactProfile - } - } /* * -path because gradle will send in paths that don't always exist. * -missing because we have tons of missing @returns and @param. @@ -935,9 +924,7 @@ class BuildPlugin implements Plugin { File heapdumpDir = new File(project.buildDir, 'heapdump') heapdumpDir.mkdirs() jvmArg '-XX:HeapDumpPath=' + heapdumpDir - if (project.runtimeJavaVersion >= JavaVersion.VERSION_1_9) { - jvmArg '--illegal-access=warn' - } + jvmArg '--illegal-access=warn' argLine System.getProperty('tests.jvm.argline') // we use './temp' since this is per JVM and tests are forbidden from writing to CWD diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy index b2a9663cf7ace..0316acef922c4 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy @@ -131,8 +131,7 @@ class PrecommitTasks { ExportElasticsearchBuildResourcesTask buildResources = project.tasks.getByName('buildResources') project.tasks.withType(CheckForbiddenApis) { dependsOn(buildResources) - targetCompatibility = project.runtimeJavaVersion >= JavaVersion.VERSION_1_9 ? - project.runtimeJavaVersion.getMajorVersion() : project.runtimeJavaVersion + targetCompatibility = project.runtimeJavaVersion.getMajorVersion() if (project.runtimeJavaVersion > JavaVersion.VERSION_11) { doLast { project.logger.info( diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index 6b6498a9a5560..d7847259defaf 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -92,6 +92,14 @@ dependencyLicenses { } thirdPartyAudit.ignoreMissingClasses ( + 'javax.activation.ActivationDataFlavor', + 'javax.activation.DataContentHandler', + 'javax.activation.DataHandler', + 'javax.activation.DataSource', + 'javax.activation.FileDataSource', + 'javax.activation.FileTypeMap', + 'javax.activation.MimeType', + 'javax.activation.MimeTypeParseException', 'javax.servlet.ServletContextEvent', 'javax.servlet.ServletContextListener', 'org.apache.avalon.framework.logger.Logger', @@ -125,121 +133,3 @@ thirdPartyAudit.ignoreMissingClasses ( 'com.sun.xml.fastinfoset.stax.StAXDocumentParser', 'com.sun.xml.fastinfoset.stax.StAXDocumentSerializer' ) - -// jarhell with jdk (intentionally, because jaxb was removed from default modules in java 9) -if (project.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { - thirdPartyAudit.ignoreJarHellWithJDK ( - 'javax.xml.bind.Binder', - 'javax.xml.bind.ContextFinder$1', - 'javax.xml.bind.ContextFinder', - 'javax.xml.bind.DataBindingException', - 'javax.xml.bind.DatatypeConverter', - 'javax.xml.bind.DatatypeConverterImpl$CalendarFormatter', - 'javax.xml.bind.DatatypeConverterImpl', - 'javax.xml.bind.DatatypeConverterInterface', - 'javax.xml.bind.Element', - 'javax.xml.bind.GetPropertyAction', - 'javax.xml.bind.JAXB$Cache', - 'javax.xml.bind.JAXB', - 'javax.xml.bind.JAXBContext', - 'javax.xml.bind.JAXBElement$GlobalScope', - 'javax.xml.bind.JAXBElement', - 'javax.xml.bind.JAXBException', - 'javax.xml.bind.JAXBIntrospector', - 'javax.xml.bind.JAXBPermission', - 'javax.xml.bind.MarshalException', - 'javax.xml.bind.Marshaller$Listener', - 'javax.xml.bind.Marshaller', - 'javax.xml.bind.Messages', - 'javax.xml.bind.NotIdentifiableEvent', - 'javax.xml.bind.ParseConversionEvent', - 'javax.xml.bind.PrintConversionEvent', - 'javax.xml.bind.PropertyException', - 'javax.xml.bind.SchemaOutputResolver', - 'javax.xml.bind.TypeConstraintException', - 'javax.xml.bind.UnmarshalException', - 'javax.xml.bind.Unmarshaller$Listener', - 'javax.xml.bind.Unmarshaller', - 'javax.xml.bind.UnmarshallerHandler', - 'javax.xml.bind.ValidationEvent', - 'javax.xml.bind.ValidationEventHandler', - 'javax.xml.bind.ValidationEventLocator', - 'javax.xml.bind.ValidationException', - 'javax.xml.bind.Validator', - 'javax.xml.bind.WhiteSpaceProcessor', - 'javax.xml.bind.annotation.DomHandler', - 'javax.xml.bind.annotation.W3CDomHandler', - 'javax.xml.bind.annotation.XmlAccessOrder', - 'javax.xml.bind.annotation.XmlAccessType', - 'javax.xml.bind.annotation.XmlAccessorOrder', - 'javax.xml.bind.annotation.XmlAccessorType', - 'javax.xml.bind.annotation.XmlAnyAttribute', - 'javax.xml.bind.annotation.XmlAnyElement', - 'javax.xml.bind.annotation.XmlAttachmentRef', - 'javax.xml.bind.annotation.XmlAttribute', - 'javax.xml.bind.annotation.XmlElement$DEFAULT', - 'javax.xml.bind.annotation.XmlElement', - 'javax.xml.bind.annotation.XmlElementDecl$GLOBAL', - 'javax.xml.bind.annotation.XmlElementDecl', - 'javax.xml.bind.annotation.XmlElementRef$DEFAULT', - 'javax.xml.bind.annotation.XmlElementRef', - 'javax.xml.bind.annotation.XmlElementRefs', - 'javax.xml.bind.annotation.XmlElementWrapper', - 'javax.xml.bind.annotation.XmlElements', - 'javax.xml.bind.annotation.XmlEnum', - 'javax.xml.bind.annotation.XmlEnumValue', - 'javax.xml.bind.annotation.XmlID', - 'javax.xml.bind.annotation.XmlIDREF', - 'javax.xml.bind.annotation.XmlInlineBinaryData', - 'javax.xml.bind.annotation.XmlList', - 'javax.xml.bind.annotation.XmlMimeType', - 'javax.xml.bind.annotation.XmlMixed', - 'javax.xml.bind.annotation.XmlNs', - 'javax.xml.bind.annotation.XmlNsForm', - 'javax.xml.bind.annotation.XmlRegistry', - 'javax.xml.bind.annotation.XmlRootElement', - 'javax.xml.bind.annotation.XmlSchema', - 'javax.xml.bind.annotation.XmlSchemaType$DEFAULT', - 'javax.xml.bind.annotation.XmlSchemaType', - 'javax.xml.bind.annotation.XmlSchemaTypes', - 'javax.xml.bind.annotation.XmlSeeAlso', - 'javax.xml.bind.annotation.XmlTransient', - 'javax.xml.bind.annotation.XmlType$DEFAULT', - 'javax.xml.bind.annotation.XmlType', - 'javax.xml.bind.annotation.XmlValue', - 'javax.xml.bind.annotation.adapters.CollapsedStringAdapter', - 'javax.xml.bind.annotation.adapters.HexBinaryAdapter', - 'javax.xml.bind.annotation.adapters.NormalizedStringAdapter', - 'javax.xml.bind.annotation.adapters.XmlAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters', - 'javax.xml.bind.attachment.AttachmentMarshaller', - 'javax.xml.bind.attachment.AttachmentUnmarshaller', - 'javax.xml.bind.helpers.AbstractMarshallerImpl', - 'javax.xml.bind.helpers.AbstractUnmarshallerImpl', - 'javax.xml.bind.helpers.DefaultValidationEventHandler', - 'javax.xml.bind.helpers.Messages', - 'javax.xml.bind.helpers.NotIdentifiableEventImpl', - 'javax.xml.bind.helpers.ParseConversionEventImpl', - 'javax.xml.bind.helpers.PrintConversionEventImpl', - 'javax.xml.bind.helpers.ValidationEventImpl', - 'javax.xml.bind.helpers.ValidationEventLocatorImpl', - 'javax.xml.bind.util.JAXBResult', - 'javax.xml.bind.util.JAXBSource$1', - 'javax.xml.bind.util.JAXBSource', - 'javax.xml.bind.util.Messages', - 'javax.xml.bind.util.ValidationEventCollector' - ) -} else { - thirdPartyAudit.ignoreMissingClasses ( - 'javax.activation.ActivationDataFlavor', - 'javax.activation.DataContentHandler', - 'javax.activation.DataHandler', - 'javax.activation.DataSource', - 'javax.activation.FileDataSource', - 'javax.activation.FileTypeMap', - 'javax.activation.MimeType', - 'javax.activation.MimeTypeParseException', - ) -} diff --git a/plugins/discovery-ec2/build.gradle b/plugins/discovery-ec2/build.gradle index f154c3d7189a0..3cab196fe9df8 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -108,9 +108,7 @@ thirdPartyAudit.ignoreMissingClasses ( 'org.apache.log.Logger' ) -if (project.runtimeJavaVersion > JavaVersion.VERSION_1_8) { - thirdPartyAudit.ignoreMissingClasses ( - 'javax.xml.bind.DatatypeConverter', - 'javax.xml.bind.JAXBContext' - ) -} +thirdPartyAudit.ignoreMissingClasses ( + 'javax.xml.bind.DatatypeConverter', + 'javax.xml.bind.JAXBContext' +) diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index d5addc663ca5b..a87f8f268bbe2 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -91,9 +91,6 @@ for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture', // If it's a secure fixture, then depend on Kerberos Fixture and principals + add the krb5conf to the JVM options if (fixtureName.equals('secureHdfsFixture') || fixtureName.equals('secureHaHdfsFixture')) { miniHDFSArgs.add("-Djava.security.krb5.conf=${project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("hdfs")}"); - if (project.runtimeJavaVersion == JavaVersion.VERSION_1_9) { - miniHDFSArgs.add('--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED') - } } // If it's an HA fixture, set a nameservice to use in the JVM options @@ -140,9 +137,6 @@ project.afterEvaluate { "${project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "elasticsearch.keytab")}" ) jvmArgs = jvmArgs + " " + "-Djava.security.krb5.conf=${krb5conf}" - if (project.runtimeJavaVersion == JavaVersion.VERSION_1_9) { - jvmArgs = jvmArgs + " " + '--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED' - } // If it's the HA + Secure tests then also set the Kerberos settings for the integration test JVM since we'll // need to auth to HDFS to trigger namenode failovers. @@ -151,9 +145,6 @@ project.afterEvaluate { restIntegTestTaskRunner.systemProperty "test.krb5.principal.es", "elasticsearch@${realm}" restIntegTestTaskRunner.systemProperty "test.krb5.principal.hdfs", "hdfs/hdfs.build.elastic.co@${realm}" restIntegTestTaskRunner.jvmArg "-Djava.security.krb5.conf=${krb5conf}" - if (project.runtimeJavaVersion == JavaVersion.VERSION_1_9) { - restIntegTestTaskRunner.jvmArg '--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED' - } restIntegTestTaskRunner.systemProperty ( "test.krb5.keytab.hdfs", project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs","hdfs_hdfs.build.elastic.co.keytab") diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 8a2edeb78c507..37acbe03022ce 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -303,111 +303,4 @@ thirdPartyAudit.ignoreMissingClasses ( 'software.amazon.ion.system.IonWriterBuilder' ) -// jarhell with jdk (intentionally, because jaxb was removed from default modules in java 9) -if (project.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { - thirdPartyAudit.ignoreJarHellWithJDK ( - 'javax.xml.bind.Binder', - 'javax.xml.bind.ContextFinder$1', - 'javax.xml.bind.ContextFinder', - 'javax.xml.bind.DataBindingException', - 'javax.xml.bind.DatatypeConverter', - 'javax.xml.bind.DatatypeConverterImpl$CalendarFormatter', - 'javax.xml.bind.DatatypeConverterImpl', - 'javax.xml.bind.DatatypeConverterInterface', - 'javax.xml.bind.Element', - 'javax.xml.bind.GetPropertyAction', - 'javax.xml.bind.JAXB$Cache', - 'javax.xml.bind.JAXB', - 'javax.xml.bind.JAXBContext', - 'javax.xml.bind.JAXBElement$GlobalScope', - 'javax.xml.bind.JAXBElement', - 'javax.xml.bind.JAXBException', - 'javax.xml.bind.JAXBIntrospector', - 'javax.xml.bind.JAXBPermission', - 'javax.xml.bind.MarshalException', - 'javax.xml.bind.Marshaller$Listener', - 'javax.xml.bind.Marshaller', - 'javax.xml.bind.Messages', - 'javax.xml.bind.NotIdentifiableEvent', - 'javax.xml.bind.ParseConversionEvent', - 'javax.xml.bind.PrintConversionEvent', - 'javax.xml.bind.PropertyException', - 'javax.xml.bind.SchemaOutputResolver', - 'javax.xml.bind.TypeConstraintException', - 'javax.xml.bind.UnmarshalException', - 'javax.xml.bind.Unmarshaller$Listener', - 'javax.xml.bind.Unmarshaller', - 'javax.xml.bind.UnmarshallerHandler', - 'javax.xml.bind.ValidationEvent', - 'javax.xml.bind.ValidationEventHandler', - 'javax.xml.bind.ValidationEventLocator', - 'javax.xml.bind.ValidationException', - 'javax.xml.bind.Validator', - 'javax.xml.bind.WhiteSpaceProcessor', - 'javax.xml.bind.annotation.DomHandler', - 'javax.xml.bind.annotation.W3CDomHandler', - 'javax.xml.bind.annotation.XmlAccessOrder', - 'javax.xml.bind.annotation.XmlAccessType', - 'javax.xml.bind.annotation.XmlAccessorOrder', - 'javax.xml.bind.annotation.XmlAccessorType', - 'javax.xml.bind.annotation.XmlAnyAttribute', - 'javax.xml.bind.annotation.XmlAnyElement', - 'javax.xml.bind.annotation.XmlAttachmentRef', - 'javax.xml.bind.annotation.XmlAttribute', - 'javax.xml.bind.annotation.XmlElement$DEFAULT', - 'javax.xml.bind.annotation.XmlElement', - 'javax.xml.bind.annotation.XmlElementDecl$GLOBAL', - 'javax.xml.bind.annotation.XmlElementDecl', - 'javax.xml.bind.annotation.XmlElementRef$DEFAULT', - 'javax.xml.bind.annotation.XmlElementRef', - 'javax.xml.bind.annotation.XmlElementRefs', - 'javax.xml.bind.annotation.XmlElementWrapper', - 'javax.xml.bind.annotation.XmlElements', - 'javax.xml.bind.annotation.XmlEnum', - 'javax.xml.bind.annotation.XmlEnumValue', - 'javax.xml.bind.annotation.XmlID', - 'javax.xml.bind.annotation.XmlIDREF', - 'javax.xml.bind.annotation.XmlInlineBinaryData', - 'javax.xml.bind.annotation.XmlList', - 'javax.xml.bind.annotation.XmlMimeType', - 'javax.xml.bind.annotation.XmlMixed', - 'javax.xml.bind.annotation.XmlNs', - 'javax.xml.bind.annotation.XmlNsForm', - 'javax.xml.bind.annotation.XmlRegistry', - 'javax.xml.bind.annotation.XmlRootElement', - 'javax.xml.bind.annotation.XmlSchema', - 'javax.xml.bind.annotation.XmlSchemaType$DEFAULT', - 'javax.xml.bind.annotation.XmlSchemaType', - 'javax.xml.bind.annotation.XmlSchemaTypes', - 'javax.xml.bind.annotation.XmlSeeAlso', - 'javax.xml.bind.annotation.XmlTransient', - 'javax.xml.bind.annotation.XmlType$DEFAULT', - 'javax.xml.bind.annotation.XmlType', - 'javax.xml.bind.annotation.XmlValue', - 'javax.xml.bind.annotation.adapters.CollapsedStringAdapter', - 'javax.xml.bind.annotation.adapters.HexBinaryAdapter', - 'javax.xml.bind.annotation.adapters.NormalizedStringAdapter', - 'javax.xml.bind.annotation.adapters.XmlAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters', - 'javax.xml.bind.attachment.AttachmentMarshaller', - 'javax.xml.bind.attachment.AttachmentUnmarshaller', - 'javax.xml.bind.helpers.AbstractMarshallerImpl', - 'javax.xml.bind.helpers.AbstractUnmarshallerImpl', - 'javax.xml.bind.helpers.DefaultValidationEventHandler', - 'javax.xml.bind.helpers.Messages', - 'javax.xml.bind.helpers.NotIdentifiableEventImpl', - 'javax.xml.bind.helpers.ParseConversionEventImpl', - 'javax.xml.bind.helpers.PrintConversionEventImpl', - 'javax.xml.bind.helpers.ValidationEventImpl', - 'javax.xml.bind.helpers.ValidationEventLocatorImpl', - 'javax.xml.bind.util.JAXBResult', - 'javax.xml.bind.util.JAXBSource$1', - 'javax.xml.bind.util.JAXBSource', - 'javax.xml.bind.util.Messages', - 'javax.xml.bind.util.ValidationEventCollector' - ) -} else { - thirdPartyAudit.ignoreMissingClasses 'javax.activation.DataHandler' -} +thirdPartyAudit.ignoreMissingClasses 'javax.activation.DataHandler' diff --git a/server/build.gradle b/server/build.gradle index 852b95cfbf14b..8f780b55e8667 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -316,9 +316,7 @@ thirdPartyAudit.ignoreMissingClasses ( 'com.google.common.geometry.S2LatLng' ) -if (project.runtimeJavaVersion > JavaVersion.VERSION_1_8) { - thirdPartyAudit.ignoreMissingClasses 'javax.xml.bind.DatatypeConverter' -} +thirdPartyAudit.ignoreMissingClasses 'javax.xml.bind.DatatypeConverter' dependencyLicenses { mapping from: /lucene-.*/, to: 'lucene' diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index be3b6a36b563b..cf825d5c10b89 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -284,21 +284,20 @@ thirdPartyAudit { ) } -if (project.runtimeJavaVersion > JavaVersion.VERSION_1_8) { - thirdPartyAudit.ignoreMissingClasses( - 'javax.xml.bind.JAXBContext', - 'javax.xml.bind.JAXBElement', - 'javax.xml.bind.JAXBException', - 'javax.xml.bind.Unmarshaller', - 'javax.xml.bind.UnmarshallerHandler', - 'javax.activation.ActivationDataFlavor', - 'javax.activation.DataContentHandler', - 'javax.activation.DataHandler', - 'javax.activation.DataSource', - 'javax.activation.FileDataSource', - 'javax.activation.FileTypeMap' - ) -} +thirdPartyAudit.ignoreMissingClasses( + 'javax.xml.bind.JAXBContext', + 'javax.xml.bind.JAXBElement', + 'javax.xml.bind.JAXBException', + 'javax.xml.bind.Unmarshaller', + 'javax.xml.bind.UnmarshallerHandler', + 'javax.activation.ActivationDataFlavor', + 'javax.activation.DataContentHandler', + 'javax.activation.DataHandler', + 'javax.activation.DataSource', + 'javax.activation.FileDataSource', + 'javax.activation.FileTypeMap' +) + run { plugin xpackModule('core') diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle index 3efa13fc32024..8293318e2d384 100644 --- a/x-pack/plugin/watcher/build.gradle +++ b/x-pack/plugin/watcher/build.gradle @@ -69,48 +69,6 @@ thirdPartyAudit { ) } -// pulled in as external dependency to work on java 9 -if (project.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { - thirdPartyAudit.ignoreJarHellWithJDK ( - // pulled in as external dependency to work on java 9 - 'com.sun.activation.registries.LineTokenizer', - 'com.sun.activation.registries.LogSupport', - 'com.sun.activation.registries.MailcapFile', - 'com.sun.activation.registries.MailcapTokenizer', - 'com.sun.activation.registries.MimeTypeEntry', - 'com.sun.activation.registries.MimeTypeFile', - 'javax.activation.MailcapCommandMap', - 'javax.activation.MimetypesFileTypeMap', - - 'com.sun.activation.registries.MailcapParseException', - 'javax.activation.ActivationDataFlavor', - 'javax.activation.CommandInfo', - 'javax.activation.CommandMap', - 'javax.activation.CommandObject', - 'javax.activation.DataContentHandler', - 'javax.activation.DataContentHandlerFactory', - 'javax.activation.DataHandler$1', - 'javax.activation.DataHandler', - 'javax.activation.DataHandlerDataSource', - 'javax.activation.DataSource', - 'javax.activation.DataSourceDataContentHandler', - 'javax.activation.FileDataSource', - 'javax.activation.FileTypeMap', - 'javax.activation.MimeType', - 'javax.activation.MimeTypeParameterList', - 'javax.activation.MimeTypeParseException', - 'javax.activation.ObjectDataContentHandler', - 'javax.activation.SecuritySupport$1', - 'javax.activation.SecuritySupport$2', - 'javax.activation.SecuritySupport$3', - 'javax.activation.SecuritySupport$4', - 'javax.activation.SecuritySupport$5', - 'javax.activation.SecuritySupport', - 'javax.activation.URLDataSource', - 'javax.activation.UnsupportedDataTypeException' - ) -} - run { plugin xpackModule('core') } From e3953c233ed92b941d97e4cea93c548adf1cb589 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sun, 7 Apr 2019 09:30:33 -0400 Subject: [PATCH 11/14] Fix test --- qa/vagrant/src/test/resources/packaging/utils/utils.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/vagrant/src/test/resources/packaging/utils/utils.bash b/qa/vagrant/src/test/resources/packaging/utils/utils.bash index 7645bb9ca6a8f..ac03daaa70b49 100644 --- a/qa/vagrant/src/test/resources/packaging/utils/utils.bash +++ b/qa/vagrant/src/test/resources/packaging/utils/utils.bash @@ -67,7 +67,7 @@ if [ ! -x "`which unzip 2>/dev/null`" ]; then exit 1 fi -if [ ! -x "`"$SYSTEM_JAVA_HOME"/bin/java 2>/dev/null`" ]; then +if [ ! -x "$SYSTEM_JAVA_HOME"/bin/java ]; then # there are some tests that move java temporarily if [ ! -x "`command -v java.bak 2>/dev/null`" ]; then echo "'java' command is mandatory to run the tests" From 9c2bfbb28711a6cfe1992e48c5427b537afd62d7 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sun, 7 Apr 2019 10:30:57 -0400 Subject: [PATCH 12/14] Fix java packaging tests execution --- .../org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy index 763b5509772af..9e6f7ef250719 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy @@ -280,7 +280,7 @@ class VagrantTestPlugin implements Plugin { else test_args=( "\$@" ) fi - java -cp "\$PACKAGING_TESTS/*" org.elasticsearch.packaging.VMTestRunner "\${test_args[@]}" + "\$SYSTEM_JAVA_HOME"/bin/java -cp "\$PACKAGING_TESTS/*" org.elasticsearch.packaging.VMTestRunner "\${test_args[@]}" """ } Task createWindowsRunnerScript = project.tasks.create('createWindowsRunnerScript', FileContentsTask) { @@ -294,7 +294,7 @@ class VagrantTestPlugin implements Plugin { } else { \$testArgs = \$args } - java -cp "\$Env:PACKAGING_TESTS/*" org.elasticsearch.packaging.VMTestRunner @testArgs + "\$Env:SYSTEM_JAVA_HOME"/bin/java -cp "\$Env:PACKAGING_TESTS/*" org.elasticsearch.packaging.VMTestRunner @testArgs exit \$LASTEXITCODE """ } From e90b71043401bdd89b9f6a51ac42536186ebcf0f Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sun, 7 Apr 2019 13:12:48 -0400 Subject: [PATCH 13/14] Fix packaging tests --- .../packaging/test/ArchiveTestCase.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java b/qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java index d427017d0b041..ac165f484054a 100644 --- a/qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java +++ b/qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java @@ -150,7 +150,7 @@ public void test50StartAndStop() throws Exception { ? "gc.log.0.current" : "gc.log"; - assertTrue("gc logs exist", Files.exists(installation.logs.resolve(gcLogName))); + assertTrue("gc logs exist", Files.exists(installation.logs.resolve("gc.log"))); ServerUtils.runElasticsearchTests(); Archives.stopElasticsearch(installation); @@ -227,16 +227,16 @@ public void test53JavaHomeWithSpecialCharacters() throws Exception { // Create temporary directory with a space and link to java binary. // Use it as java_home String nameWithSpace = RandomStrings.randomAsciiAlphanumOfLength(getRandom(), 10) + "java home"; - String test_java_home = FileUtils.mkdir(Paths.get("/home",ARCHIVE_OWNER, nameWithSpace)).toAbsolutePath().toString(); + String testJavaHome = FileUtils.mkdir(Paths.get("/home", ARCHIVE_OWNER, nameWithSpace)).toAbsolutePath().toString(); try { final String systemJavaHome = sh.run("echo $SYSTEM_JAVA_HOME").stdout.trim(); final String java = systemJavaHome + "/bin/java"; - sh.run("mkdir -p \"" + test_java_home + "/bin\""); - sh.run("ln -s \"" + java + "\" \"" + test_java_home + "/bin/java\""); - sh.run("chown -R " + ARCHIVE_OWNER + ":" + ARCHIVE_OWNER + " \"" + test_java_home + "\""); + sh.run("mkdir -p \"" + testJavaHome + "/bin\""); + sh.run("ln -s \"" + java + "\" \"" + testJavaHome + "/bin/java\""); + sh.run("chown -R " + ARCHIVE_OWNER + ":" + ARCHIVE_OWNER + " \"" + testJavaHome + "\""); - sh.getEnv().put("JAVA_HOME", test_java_home); + sh.getEnv().put("JAVA_HOME", testJavaHome); //verify ES can start, stop and run plugin list Archives.runElasticsearch(installation, sh); @@ -247,7 +247,7 @@ public void test53JavaHomeWithSpecialCharacters() throws Exception { Result result = sh.run(pluginListCommand); assertThat(result.exitCode, equalTo(0)); } finally { - FileUtils.rm(Paths.get("\"" + test_java_home + "\"")); + FileUtils.rm(Paths.get("\"" + testJavaHome + "\"")); } }); } From 1c7e2999532da07200f3d7406ab2bbcb3a7ff8cc Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sun, 7 Apr 2019 13:14:19 -0400 Subject: [PATCH 14/14] Remove dead local --- .../org/elasticsearch/packaging/test/ArchiveTestCase.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java b/qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java index ac165f484054a..4078dfc4f97db 100644 --- a/qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java +++ b/qa/vagrant/src/main/java/org/elasticsearch/packaging/test/ArchiveTestCase.java @@ -146,10 +146,6 @@ public void test50StartAndStop() throws Exception { Archives.runElasticsearch(installation, newShell()); - final String gcLogName = Platforms.LINUX && distribution().hasJdk == false - ? "gc.log.0.current" - : "gc.log"; - assertTrue("gc logs exist", Files.exists(installation.logs.resolve("gc.log"))); ServerUtils.runElasticsearchTests();