HHH-13275 Re-introduce usage of net.bytebuddy.experimental=true when testing on JDK > 11

This commit is contained in:
Sanne Grinovero 2019-02-18 14:14:24 +00:00
parent d39921bd34
commit 7fbcfe83b2
1 changed files with 12 additions and 0 deletions

View File

@ -203,6 +203,18 @@ processTestResources {
}
}
// Enable the experimental features of ByteBuddy with JDK 12+
test {
//Only safe to attempt to parse the version as an integer since JDK11
if ( JavaVersion.current().isJava11Compatible() ) {
int majorJVMVersionInt = Integer.valueOf(JavaVersion.current().toString());
//Set the -Dnet.bytebuddy.experimental=true property only when we need it:
if (majorJVMVersionInt >= 12) {
systemProperty 'net.bytebuddy.experimental', true
}
}
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// IDE