diff --git a/plugin/build.gradle b/plugin/build.gradle index c661a9d6fc2..7b624864ad0 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -224,7 +224,7 @@ task createNodeKeyStore(type: LoggedExec) { delete nodeKeystore } } - executable = new File(project.javaHome, 'bin/keytool') + executable = new File(project.runtimeJavaHome, 'bin/keytool') standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8')) args '-genkey', '-alias', 'test-node', diff --git a/plugin/bwc-snapshot-dummy-projects/build.gradle b/plugin/bwc-snapshot-dummy-projects/build.gradle index 04c8115e2a3..a4492f011f7 100644 --- a/plugin/bwc-snapshot-dummy-projects/build.gradle +++ b/plugin/bwc-snapshot-dummy-projects/build.gradle @@ -186,25 +186,31 @@ subprojects { task buildBwcVersion(type: Exec) { dependsOn checkoutXPackBwcBranch, checkoutElasticsearchBwcBranch, writeElasticsearchBuildMetadata, writeXPackBuildMetadata workingDir = xpackCheckoutDir + if (project.rootProject.ext.runtimeJavaVersion == JavaVersion.VERSION_1_8 && ["5.6", "6.0", "6.1"].contains(bwcBranch)) { + /* + * If runtime Java home is set to JDK 8 and we are building branches that are officially built with JDK 8, push this to JAVA_HOME for + * these builds. + */ + environment('JAVA_HOME', System.getenv('RUNTIME_JAVA_HOME')) + } if (Os.isFamily(Os.FAMILY_WINDOWS)) { executable 'cmd' args '/C', 'call', new File(xpackCheckoutDir, 'gradlew').toString() } else { - executable = new File(xpackCheckoutDir, 'gradlew').toString() + executable new File(xpackCheckoutDir, 'gradlew').toString() } - final ArrayList commandLineArgs = [":x-pack-elasticsearch:plugin:assemble", "-Dbuild.snapshot=${System.getProperty('build.snapshot') ?: 'true'}"] + args ":x-pack-elasticsearch:plugin:assemble", "-Dbuild.snapshot=${System.getProperty('build.snapshot') ?: 'true'}" final LogLevel logLevel = gradle.startParameter.logLevel if ([LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG].contains(logLevel)) { - commandLineArgs << "--${logLevel.name().toLowerCase(Locale.ENGLISH)}" + args "--${logLevel.name().toLowerCase(Locale.ENGLISH)}" } final String showStacktraceName = gradle.startParameter.showStacktrace.name() assert ["INTERNAL_EXCEPTIONS", "ALWAYS", "ALWAYS_FULL"].contains(showStacktraceName) if (showStacktraceName.equals("ALWAYS")) { - commandLineArgs << "--stacktrace" + args "--stacktrace" } else if (showStacktraceName.equals("ALWAYS_FULL")) { - commandLineArgs << "--full-stacktrace" + args "--full-stacktrace" } - args commandLineArgs } artifacts { diff --git a/qa/smoke-test-plugins-ssl/build.gradle b/qa/smoke-test-plugins-ssl/build.gradle index 2aef43a1774..75b089bd22c 100644 --- a/qa/smoke-test-plugins-ssl/build.gradle +++ b/qa/smoke-test-plugins-ssl/build.gradle @@ -42,7 +42,7 @@ task createNodeKeyStore(type: LoggedExec) { delete nodeKeystore } } - executable = new File(project.javaHome, 'bin/keytool') + executable = new File(project.runtimeJavaHome, 'bin/keytool') standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8')) args '-genkey', '-alias', 'test-node', @@ -67,7 +67,7 @@ task createClientKeyStore(type: LoggedExec) { delete clientKeyStore } } - executable = new File(project.javaHome, 'bin/keytool') + executable = new File(project.runtimeJavaHome, 'bin/keytool') standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8')) args '-genkey', '-alias', 'test-client', @@ -92,7 +92,7 @@ task exportNodeCertificate(type: LoggedExec) { delete nodeCertificate } } - executable = new File(project.javaHome, 'bin/keytool') + executable = new File(project.runtimeJavaHome, 'bin/keytool') args '-export', '-alias', 'test-node', '-keystore', nodeKeystore, @@ -103,7 +103,7 @@ task exportNodeCertificate(type: LoggedExec) { // Import the node certificate in the client's keystore task importNodeCertificateInClientKeyStore(type: LoggedExec) { dependsOn exportNodeCertificate - executable = new File(project.javaHome, 'bin/keytool') + executable = new File(project.runtimeJavaHome, 'bin/keytool') args '-import', '-alias', 'test-node', '-keystore', clientKeyStore, @@ -123,7 +123,7 @@ task exportClientCertificate(type: LoggedExec) { delete clientCertificate } } - executable = new File(project.javaHome, 'bin/keytool') + executable = new File(project.runtimeJavaHome, 'bin/keytool') args '-export', '-alias', 'test-client', '-keystore', clientKeyStore, @@ -134,7 +134,7 @@ task exportClientCertificate(type: LoggedExec) { // Import the client certificate in the node's keystore task importClientCertificateInNodeKeyStore(type: LoggedExec) { dependsOn exportClientCertificate - executable = new File(project.javaHome, 'bin/keytool') + executable = new File(project.runtimeJavaHome, 'bin/keytool') args '-import', '-alias', 'test-client', '-keystore', nodeKeystore,