Skip to content

Commit 132767b

Browse files
dreab8Sanne
authored andcommitted
HHH-12001 - Allow ORM to be built with Java 9
1 parent 85dcac9 commit 132767b

File tree

8 files changed

+56
-48
lines changed

8 files changed

+56
-48
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ subprojects { subProject ->
244244
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
245245
// testing
246246
subProject.tasks.withType( Test.class ).all { task ->
247+
if ( JavaVersion.current().isJava9Compatible() ) {
248+
// Byteman needs this property to be set, https://developer.jboss.org/thread/274997
249+
task.jvmArgs += ["-Djdk.attach.allowAttachSelf=true"]
250+
}
247251
task.jvmArgs += [
248252
'-XX:+HeapDumpOnOutOfMemoryError',
249253
"-XX:HeapDumpPath=${project.file( "${project.buildDir}/OOM-dump.hprof" ).absolutePath}",

hibernate-core/hibernate-core.gradle

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -221,25 +221,6 @@ artifacts {
221221
tests testJar
222222
}
223223

224-
if ( JavaVersion.current().isJava9Compatible() ) {
225-
logger.warn( '[WARN] Skipping Javassist-related tests for hibernate-core due to Javassist JDK 9 incompatibility' )
226-
227-
// we need to exclude tests using Javassist enhancement, which does not properly support
228-
// Java 9 yet - https://issues.jboss.org/browse/JASSIST-261
229-
test {
230-
// rather than wild-cards, keep an explicit list
231-
exclude 'org/hibernate/jpa/test/enhancement/InterceptFieldClassFileTransformerTest.class'
232-
exclude 'org/hibernate/jpa/test/enhancement/runtime/JpaRuntimeEnhancementTest.class'
233-
exclude 'org/hibernate/test/bytecode/enhancement/EnhancerTest.class'
234-
exclude 'org/hibernate/test/bytecode/enhancement/basic/BasicInSessionTest.class'
235-
236-
// also, any tests using Arquillian for in-container testing with WildFly currently
237-
// need to be excluded because WildFly does not yet work with Java 9
238-
exclude 'org/hibernate/test/wf/ddl/**'
239-
exclude 'org/hibernate/jpa/test/cdi/**'
240-
}
241-
}
242-
243224
processTestResources {
244225
doLast {
245226
copy {

hibernate-envers/hibernate-envers.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,3 @@ tasks."matrix_mariadb" {
9191
println "Starting test: " + descriptor
9292
}
9393
}
94-
95-
if ( JavaVersion.current().isJava9Compatible() ) {
96-
logger.warn( '[WARN] Skipping Javassist-related tests for hibernate-envers due to Javassist JDK 9 incompatibility' )
97-
98-
// we need to exclude tests using Javassist enhancement, which does not properly support
99-
// Java 9 yet - https://issues.jboss.org/browse/JASSIST-261
100-
test {
101-
// rather than wild-cards, keep an explicit list
102-
exclude 'org/hibernate/envers/internal/tools/MapProxyTest.class'
103-
exclude 'org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentTest.class'
104-
exclude 'org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentsAdvancedCasesTest.class'
105-
}
106-
}

hibernate-hikaricp/hibernate-hikaricp.gradle

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,3 @@ mavenPom {
4444
def osgiDescription() {
4545
return mavenPom.description
4646
}
47-
48-
if ( JavaVersion.current().isJava9Compatible() ) {
49-
logger.warn( '[WARN] Skipping all tests for hibernate-hikaricp due to Javassist JDK 9 incompatibility' )
50-
51-
// Hikari CP relies on Javassist which we know has issues with Java 9
52-
test.enabled = false
53-
}

hibernate-orm-modules/hibernate-orm-modules.gradle

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,29 @@ dependencies {
7272
testCompile libraries.shrinkwrap_descriptors_api_javaee
7373
testCompile libraries.shrinkwrap_descriptors_impl_javaee
7474
testCompile libraries.wildfly_arquillian_container_managed
75+
76+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77+
// Java 9 ftw!
78+
if ( JavaVersion.current().isJava9Compatible() ) {
79+
compile( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
80+
compile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
81+
compile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
82+
compile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
83+
compile( 'javax:javaee-api:7.0' )
84+
85+
testCompile( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
86+
testCompile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
87+
testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
88+
testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
89+
testCompile( 'javax:javaee-api:7.0' )
90+
91+
testRuntime( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
92+
testRuntime( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
93+
testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
94+
testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
95+
testRuntime( 'javax:javaee-api:7.0' )
96+
}
97+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7598
}
7699

77100

@@ -154,12 +177,6 @@ build.dependsOn createModulesZip
154177
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
155178
// tasks related to in-container (Arquillian + WF) testing
156179

157-
if ( JavaVersion.current().isJava9Compatible() ) {
158-
logger.lifecycle( "WARNING - Skipping hibernate-orm-modules tests for Java 9" )
159-
// WildFly has problems booting in Java 9
160-
test.enabled = false
161-
}
162-
163180
task installWildFly(type: Copy) {
164181
description = 'Downloads the WildFly distribution and installs it into a local directory (if needed)'
165182

hibernate-osgi/hibernate-osgi.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ publishing {
412412
}
413413

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

hibernate-proxool/hibernate-proxool.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,31 @@ dependencies {
88
compile project( ':hibernate-core' )
99
compile( libraries.proxool )
1010
testCompile project( ':hibernate-testing' )
11+
12+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13+
// Java 9 ftw!
14+
if ( JavaVersion.current().isJava9Compatible() ) {
15+
// The JDK used to run Gradle is Java 9+, and we assume that that is the same
16+
//JDK for executing tasks
17+
compile( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
18+
compile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
19+
compile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
20+
compile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
21+
compile( 'javax:javaee-api:7.0' )
22+
23+
testCompile( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
24+
testCompile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
25+
testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
26+
testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
27+
testCompile( 'javax:javaee-api:7.0' )
28+
29+
testRuntime( 'com.sun.xml.bind:jaxb-impl:2.2.11' )
30+
testRuntime( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' )
31+
testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' )
32+
testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' )
33+
testRuntime( 'javax:javaee-api:7.0' )
34+
}
35+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1136
}
1237

1338
mavenPom {

libraries.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ext {
1212
junitVersion = '4.12'
1313
// h2Version = '1.2.145'
1414
h2Version = '1.3.176'
15-
bytemanVersion = '3.0.6'
15+
bytemanVersion = '3.0.10'
1616
infinispanVersion = '8.2.5.Final'
1717
jnpVersion = '5.0.6.CR1'
1818
elVersion = '2.2.4'
@@ -105,8 +105,8 @@ ext {
105105
informix: 'com.ibm.informix:jdbc:4.10.7.20160517',
106106
jboss_jta: "org.jboss.jbossts:jbossjta:4.16.4.Final",
107107
xapool: "com.experlog:xapool:1.5.0",
108-
mockito: 'org.mockito:mockito-core:2.7.5',
109-
mockito_inline: 'org.mockito:mockito-inline:2.7.5',
108+
mockito: 'org.mockito:mockito-core:2.10.0',
109+
mockito_inline: 'org.mockito:mockito-inline:2.10.0',
110110

111111
validator: 'org.hibernate:hibernate-validator:5.2.4.Final',
112112
// EL required by Hibernate Validator at test runtime

0 commit comments

Comments
 (0)