SQL: Adapt to compile and runtime Java home distinction

Relates elastic/x-pack-elasticsearch#3477

Original commit: elastic/x-pack-elasticsearch@5791617988
This commit is contained in:
Igor Motov 2018-01-16 14:53:49 -05:00
parent 35b45e9a14
commit 9401569195
3 changed files with 8 additions and 8 deletions

View File

@ -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}"

View File

@ -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,

View File

@ -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'
}