From 94015691954c2f6ef2b560c7293605521cf3fab5 Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Tue, 16 Jan 2018 14:53:49 -0500 Subject: [PATCH] SQL: Adapt to compile and runtime Java home distinction Relates elastic/x-pack-elasticsearch#3477 Original commit: elastic/x-pack-elasticsearch@5791617988b73beb78230f92adc2b2c1e0345aed --- qa/sql/build.gradle | 2 +- qa/sql/security/ssl/build.gradle | 12 ++++++------ sql/cli/build.gradle | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qa/sql/build.gradle b/qa/sql/build.gradle index f6d844b318b..c4b1209239c 100644 --- a/qa/sql/build.gradle +++ b/qa/sql/build.gradle @@ -128,7 +128,7 @@ subprojects { Project cli = project(':x-pack-elasticsearch:sql:cli') dependsOn project.configurations.cliFixture dependsOn cli.jar - executable = new File(project.javaHome, 'bin/java') + executable = new File(project.runtimeJavaHome, 'bin/java') env 'CLASSPATH', "${ -> project.configurations.cliFixture.asPath }" args 'org.elasticsearch.xpack.sql.cli.fixture.CliFixture', baseDir, "${ -> cli.jar.outputs.files.singleFile}" diff --git a/qa/sql/security/ssl/build.gradle b/qa/sql/security/ssl/build.gradle index ffe66b816df..de4bac77452 100644 --- a/qa/sql/security/ssl/build.gradle +++ b/qa/sql/security/ssl/build.gradle @@ -32,7 +32,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', @@ -57,7 +57,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', @@ -82,7 +82,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, @@ -93,7 +93,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, @@ -113,7 +113,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, @@ -124,7 +124,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, diff --git a/sql/cli/build.gradle b/sql/cli/build.gradle index 8db1cffa678..14c1c604907 100644 --- a/sql/cli/build.gradle +++ b/sql/cli/build.gradle @@ -73,7 +73,7 @@ task runcli { description = 'Run the CLI and connect to elasticsearch running on 9200' dependsOn 'assemble' doLast { - List command = [new File(project.javaHome, 'bin/java').absolutePath] + List command = [new File(project.runtimeJavaHome, 'bin/java').absolutePath] if ('true'.equals(System.getProperty('debug', 'false'))) { command += '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000' }