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:
parent
35b45e9a14
commit
9401569195
|
@ -128,7 +128,7 @@ subprojects {
|
||||||
Project cli = project(':x-pack-elasticsearch:sql:cli')
|
Project cli = project(':x-pack-elasticsearch:sql:cli')
|
||||||
dependsOn project.configurations.cliFixture
|
dependsOn project.configurations.cliFixture
|
||||||
dependsOn cli.jar
|
dependsOn cli.jar
|
||||||
executable = new File(project.javaHome, 'bin/java')
|
executable = new File(project.runtimeJavaHome, 'bin/java')
|
||||||
env 'CLASSPATH', "${ -> project.configurations.cliFixture.asPath }"
|
env 'CLASSPATH', "${ -> project.configurations.cliFixture.asPath }"
|
||||||
args 'org.elasticsearch.xpack.sql.cli.fixture.CliFixture',
|
args 'org.elasticsearch.xpack.sql.cli.fixture.CliFixture',
|
||||||
baseDir, "${ -> cli.jar.outputs.files.singleFile}"
|
baseDir, "${ -> cli.jar.outputs.files.singleFile}"
|
||||||
|
|
|
@ -32,7 +32,7 @@ task createNodeKeyStore(type: LoggedExec) {
|
||||||
delete nodeKeystore
|
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'))
|
standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8'))
|
||||||
args '-genkey',
|
args '-genkey',
|
||||||
'-alias', 'test-node',
|
'-alias', 'test-node',
|
||||||
|
@ -57,7 +57,7 @@ task createClientKeyStore(type: LoggedExec) {
|
||||||
delete clientKeyStore
|
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'))
|
standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8'))
|
||||||
args '-genkey',
|
args '-genkey',
|
||||||
'-alias', 'test-client',
|
'-alias', 'test-client',
|
||||||
|
@ -82,7 +82,7 @@ task exportNodeCertificate(type: LoggedExec) {
|
||||||
delete nodeCertificate
|
delete nodeCertificate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
executable = new File(project.javaHome, 'bin/keytool')
|
executable = new File(project.runtimeJavaHome, 'bin/keytool')
|
||||||
args '-export',
|
args '-export',
|
||||||
'-alias', 'test-node',
|
'-alias', 'test-node',
|
||||||
'-keystore', nodeKeystore,
|
'-keystore', nodeKeystore,
|
||||||
|
@ -93,7 +93,7 @@ task exportNodeCertificate(type: LoggedExec) {
|
||||||
// Import the node certificate in the client's keystore
|
// Import the node certificate in the client's keystore
|
||||||
task importNodeCertificateInClientKeyStore(type: LoggedExec) {
|
task importNodeCertificateInClientKeyStore(type: LoggedExec) {
|
||||||
dependsOn exportNodeCertificate
|
dependsOn exportNodeCertificate
|
||||||
executable = new File(project.javaHome, 'bin/keytool')
|
executable = new File(project.runtimeJavaHome, 'bin/keytool')
|
||||||
args '-import',
|
args '-import',
|
||||||
'-alias', 'test-node',
|
'-alias', 'test-node',
|
||||||
'-keystore', clientKeyStore,
|
'-keystore', clientKeyStore,
|
||||||
|
@ -113,7 +113,7 @@ task exportClientCertificate(type: LoggedExec) {
|
||||||
delete clientCertificate
|
delete clientCertificate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
executable = new File(project.javaHome, 'bin/keytool')
|
executable = new File(project.runtimeJavaHome, 'bin/keytool')
|
||||||
args '-export',
|
args '-export',
|
||||||
'-alias', 'test-client',
|
'-alias', 'test-client',
|
||||||
'-keystore', clientKeyStore,
|
'-keystore', clientKeyStore,
|
||||||
|
@ -124,7 +124,7 @@ task exportClientCertificate(type: LoggedExec) {
|
||||||
// Import the client certificate in the node's keystore
|
// Import the client certificate in the node's keystore
|
||||||
task importClientCertificateInNodeKeyStore(type: LoggedExec) {
|
task importClientCertificateInNodeKeyStore(type: LoggedExec) {
|
||||||
dependsOn exportClientCertificate
|
dependsOn exportClientCertificate
|
||||||
executable = new File(project.javaHome, 'bin/keytool')
|
executable = new File(project.runtimeJavaHome, 'bin/keytool')
|
||||||
args '-import',
|
args '-import',
|
||||||
'-alias', 'test-client',
|
'-alias', 'test-client',
|
||||||
'-keystore', nodeKeystore,
|
'-keystore', nodeKeystore,
|
||||||
|
|
|
@ -73,7 +73,7 @@ task runcli {
|
||||||
description = 'Run the CLI and connect to elasticsearch running on 9200'
|
description = 'Run the CLI and connect to elasticsearch running on 9200'
|
||||||
dependsOn 'assemble'
|
dependsOn 'assemble'
|
||||||
doLast {
|
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'))) {
|
if ('true'.equals(System.getProperty('debug', 'false'))) {
|
||||||
command += '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000'
|
command += '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue