Allow build to directly run under JDK 9 (elastic/x-pack-elasticsearch#2320)
With Gradle 4.1 and newer JDK versions, we can finally invoke Gradle directly using a JDK9 JAVA_HOME without requiring a JDK8 to "bootstrap" the build. As the thirdPartyAudit task runs within the JVM that Gradle runs in, it needs to be adapted now to be JDK9 aware. Relates to elastic/elasticsearch#25859 Original commit: elastic/x-pack-elasticsearch@4bf266e0b0
This commit is contained in:
parent
3f541fa556
commit
b4353b55ad
|
@ -290,10 +290,17 @@ thirdPartyAudit.excludes = [
|
||||||
'com.sun.activation.registries.LineTokenizer',
|
'com.sun.activation.registries.LineTokenizer',
|
||||||
'com.sun.activation.registries.LogSupport',
|
'com.sun.activation.registries.LogSupport',
|
||||||
'com.sun.activation.registries.MailcapFile',
|
'com.sun.activation.registries.MailcapFile',
|
||||||
'com.sun.activation.registries.MailcapParseException',
|
|
||||||
'com.sun.activation.registries.MailcapTokenizer',
|
'com.sun.activation.registries.MailcapTokenizer',
|
||||||
'com.sun.activation.registries.MimeTypeEntry',
|
'com.sun.activation.registries.MimeTypeEntry',
|
||||||
'com.sun.activation.registries.MimeTypeFile',
|
'com.sun.activation.registries.MimeTypeFile',
|
||||||
|
'javax.activation.MailcapCommandMap',
|
||||||
|
'javax.activation.MimetypesFileTypeMap',
|
||||||
|
]
|
||||||
|
|
||||||
|
// pulled in as external dependency to work on java 9
|
||||||
|
if (JavaVersion.current() <= JavaVersion.VERSION_1_8) {
|
||||||
|
thirdPartyAudit.excludes += [
|
||||||
|
'com.sun.activation.registries.MailcapParseException',
|
||||||
'javax.activation.ActivationDataFlavor',
|
'javax.activation.ActivationDataFlavor',
|
||||||
'javax.activation.CommandInfo',
|
'javax.activation.CommandInfo',
|
||||||
'javax.activation.CommandMap',
|
'javax.activation.CommandMap',
|
||||||
|
@ -307,11 +314,9 @@ thirdPartyAudit.excludes = [
|
||||||
'javax.activation.DataSourceDataContentHandler',
|
'javax.activation.DataSourceDataContentHandler',
|
||||||
'javax.activation.FileDataSource',
|
'javax.activation.FileDataSource',
|
||||||
'javax.activation.FileTypeMap',
|
'javax.activation.FileTypeMap',
|
||||||
'javax.activation.MailcapCommandMap',
|
|
||||||
'javax.activation.MimeType',
|
'javax.activation.MimeType',
|
||||||
'javax.activation.MimeTypeParameterList',
|
'javax.activation.MimeTypeParameterList',
|
||||||
'javax.activation.MimeTypeParseException',
|
'javax.activation.MimeTypeParseException',
|
||||||
'javax.activation.MimetypesFileTypeMap',
|
|
||||||
'javax.activation.ObjectDataContentHandler',
|
'javax.activation.ObjectDataContentHandler',
|
||||||
'javax.activation.SecuritySupport$1',
|
'javax.activation.SecuritySupport$1',
|
||||||
'javax.activation.SecuritySupport$2',
|
'javax.activation.SecuritySupport$2',
|
||||||
|
@ -321,7 +326,8 @@ thirdPartyAudit.excludes = [
|
||||||
'javax.activation.SecuritySupport',
|
'javax.activation.SecuritySupport',
|
||||||
'javax.activation.URLDataSource',
|
'javax.activation.URLDataSource',
|
||||||
'javax.activation.UnsupportedDataTypeException'
|
'javax.activation.UnsupportedDataTypeException'
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
|
||||||
run {
|
run {
|
||||||
setting 'xpack.ml.enabled', 'true'
|
setting 'xpack.ml.enabled', 'true'
|
||||||
|
|
|
@ -21,6 +21,9 @@ buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath group: 'com.bettercloud', name: 'vault-java-driver', version:"1.1.0"
|
classpath group: 'com.bettercloud', name: 'vault-java-driver', version:"1.1.0"
|
||||||
classpath 'com.amazonaws:aws-java-sdk-s3:1.10.33'
|
classpath 'com.amazonaws:aws-java-sdk-s3:1.10.33'
|
||||||
|
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
|
||||||
|
classpath 'com.sun.xml.bind:jaxb-impl:2.2.3-1' // pulled in as external dependency to work on java 9
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,17 +43,17 @@ void checkJavaVersion() {
|
||||||
final String javaVendor = System.getProperty('java.vendor')
|
final String javaVendor = System.getProperty('java.vendor')
|
||||||
def matcher = javaVersion =~ /1\.8\.0(?:_(\d+))?/
|
def matcher = javaVersion =~ /1\.8\.0(?:_(\d+))?/
|
||||||
boolean matches = matcher.matches()
|
boolean matches = matcher.matches()
|
||||||
assert matches
|
if (matches) {
|
||||||
|
final int update
|
||||||
final int update
|
if (matcher.group(1) == null) {
|
||||||
if (matcher.group(1) == null) {
|
update = 0
|
||||||
update = 0
|
} else {
|
||||||
} else {
|
update = matcher.group(1).toInteger()
|
||||||
update = matcher.group(1).toInteger()
|
}
|
||||||
}
|
if (update < 101) {
|
||||||
if (update < 101) {
|
throw new GradleException("JDK ${javaVendor} ${javaVersion} does not have necessary root certificates " +
|
||||||
throw new GradleException("JDK ${javaVendor} ${javaVersion} does not have necessary root certificates " +
|
"(https://bugs.openjdk.java.net/browse/JDK-8154757), update your JDK to at least JDK 8u101+")
|
||||||
"(https://bugs.openjdk.java.net/browse/JDK-8154757), update your JDK to at least JDK 8u101+")
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue