HHH-12001 - Allow ORM to be built with Java 9

This commit is contained in:
Andrea Boriero 2017-09-21 11:54:35 +01:00 committed by Sanne Grinovero
parent 85dcac95d0
commit 132767b4fb
8 changed files with 56 additions and 48 deletions

View File

@ -244,6 +244,10 @@ subprojects { subProject ->
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// testing
subProject.tasks.withType( Test.class ).all { task ->
if ( JavaVersion.current().isJava9Compatible() ) {
// Byteman needs this property to be set, https://developer.jboss.org/thread/274997
task.jvmArgs += ["-Djdk.attach.allowAttachSelf=true"]
}
task.jvmArgs += [
'-XX:+HeapDumpOnOutOfMemoryError',
"-XX:HeapDumpPath=${project.file( "${project.buildDir}/OOM-dump.hprof" ).absolutePath}",

View File

@ -221,25 +221,6 @@ artifacts {
tests testJar
}
if ( JavaVersion.current().isJava9Compatible() ) {
logger.warn( '[WARN] Skipping Javassist-related tests for hibernate-core due to Javassist JDK 9 incompatibility' )
// we need to exclude tests using Javassist enhancement, which does not properly support
// Java 9 yet - https://issues.jboss.org/browse/JASSIST-261
test {
// rather than wild-cards, keep an explicit list
exclude 'org/hibernate/jpa/test/enhancement/InterceptFieldClassFileTransformerTest.class'
exclude 'org/hibernate/jpa/test/enhancement/runtime/JpaRuntimeEnhancementTest.class'
exclude 'org/hibernate/test/bytecode/enhancement/EnhancerTest.class'
exclude 'org/hibernate/test/bytecode/enhancement/basic/BasicInSessionTest.class'
// also, any tests using Arquillian for in-container testing with WildFly currently
// need to be excluded because WildFly does not yet work with Java 9
exclude 'org/hibernate/test/wf/ddl/**'
exclude 'org/hibernate/jpa/test/cdi/**'
}
}
processTestResources {
doLast {
copy {

View File

@ -91,16 +91,3 @@ tasks."matrix_mariadb" {
println "Starting test: " + descriptor
}
}
if ( JavaVersion.current().isJava9Compatible() ) {
logger.warn( '[WARN] Skipping Javassist-related tests for hibernate-envers due to Javassist JDK 9 incompatibility' )
// we need to exclude tests using Javassist enhancement, which does not properly support
// Java 9 yet - https://issues.jboss.org/browse/JASSIST-261
test {
// rather than wild-cards, keep an explicit list
exclude 'org/hibernate/envers/internal/tools/MapProxyTest.class'
exclude 'org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentTest.class'
exclude 'org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentsAdvancedCasesTest.class'
}
}

View File

@ -44,10 +44,3 @@ mavenPom {
def osgiDescription() {
return mavenPom.description
}
if ( JavaVersion.current().isJava9Compatible() ) {
logger.warn( '[WARN] Skipping all tests for hibernate-hikaricp due to Javassist JDK 9 incompatibility' )
// Hikari CP relies on Javassist which we know has issues with Java 9
test.enabled = false
}

View File

@ -72,6 +72,29 @@ dependencies {
testCompile libraries.shrinkwrap_descriptors_api_javaee
testCompile libraries.shrinkwrap_descriptors_impl_javaee
testCompile libraries.wildfly_arquillian_container_managed
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Java 9 ftw!
if ( JavaVersion.current().isJava9Compatible() ) {
compile( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
compile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
compile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
compile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
compile( 'javax:javaee-api:7.0' )
testCompile( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
testCompile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
testCompile( 'javax:javaee-api:7.0' )
testRuntime( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
testRuntime( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
testRuntime( 'javax:javaee-api:7.0' )
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}
@ -154,12 +177,6 @@ build.dependsOn createModulesZip
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// tasks related to in-container (Arquillian + WF) testing
if ( JavaVersion.current().isJava9Compatible() ) {
logger.lifecycle( "WARNING - Skipping hibernate-orm-modules tests for Java 9" )
// WildFly has problems booting in Java 9
test.enabled = false
}
task installWildFly(type: Copy) {
description = 'Downloads the WildFly distribution and installs it into a local directory (if needed)'

View File

@ -412,6 +412,7 @@ publishing {
}
if ( JavaVersion.current().isJava9Compatible() ) {
logger.warn( '[WARN] Skipping all tests for hibernate-osg due to Karaf issues with JDK 9' )
// Hikari CP relies on Javassist which we know has issues with Java 9
test.enabled = false
}

View File

@ -8,6 +8,31 @@ dependencies {
compile project( ':hibernate-core' )
compile( libraries.proxool )
testCompile project( ':hibernate-testing' )
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Java 9 ftw!
if ( JavaVersion.current().isJava9Compatible() ) {
// The JDK used to run Gradle is Java 9+, and we assume that that is the same
// JDK for executing tasks
compile( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
compile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
compile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
compile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
compile( 'javax:javaee-api:7.0' )
testCompile( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
testCompile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
testCompile( 'javax:javaee-api:7.0' )
testRuntime( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
testRuntime( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
testRuntime( 'javax:javaee-api:7.0' )
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}
mavenPom {

View File

@ -12,7 +12,7 @@ ext {
junitVersion = '4.12'
// h2Version = '1.2.145'
h2Version = '1.3.176'
bytemanVersion = '3.0.6'
bytemanVersion = '3.0.10'
infinispanVersion = '8.2.5.Final'
jnpVersion = '5.0.6.CR1'
elVersion = '2.2.4'
@ -105,8 +105,8 @@ ext {
informix: 'com.ibm.informix:jdbc:4.10.7.20160517',
jboss_jta: "org.jboss.jbossts:jbossjta:4.16.4.Final",
xapool: "com.experlog:xapool:1.5.0",
mockito: 'org.mockito:mockito-core:2.7.5',
mockito_inline: 'org.mockito:mockito-inline:2.7.5',
mockito: 'org.mockito:mockito-core:2.10.0',
mockito_inline: 'org.mockito:mockito-inline:2.10.0',
validator: 'org.hibernate:hibernate-validator:5.2.4.Final',
// EL required by Hibernate Validator at test runtime