@@ -10,13 +10,16 @@ plugins {
10
10
id ' org.hibernate.build.xjc-jakarta'
11
11
}
12
12
13
+ repositories {
14
+ gradlePluginPortal()
15
+ }
16
+
13
17
description = ' Hibernate\' s core ORM functionality'
14
18
15
19
apply from : rootProject. file( ' gradle/published-java-module.gradle' )
16
20
apply plugin : ' org.hibernate.orm.antlr'
17
21
apply plugin : ' org.hibernate.matrix-test'
18
22
19
-
20
23
configurations {
21
24
tests {
22
25
description = ' Configuration for the produced test jar'
@@ -45,6 +48,7 @@ dependencies {
45
48
compileOnly jakartaLibs. jsonbApi
46
49
compileOnly libs. jackson
47
50
compileOnly libs. jacksonXml
51
+ compileOnly dbLibs. postgresql
48
52
49
53
testImplementation project(' :hibernate-testing' )
50
54
testImplementation project(' :hibernate-ant' )
@@ -62,14 +66,15 @@ dependencies {
62
66
}
63
67
testImplementation " joda-time:joda-time:2.3"
64
68
testImplementation files(' /app/libs/aws-advanced-jdbc-wrapper-2.3.3.jar' )
65
- testImplementation dbLibs. postgresql
66
- testImplementation dbLibs. mysql
67
69
testImplementation dbLibs. h2
68
70
69
71
testRuntimeOnly libs. byteBuddy
70
72
testRuntimeOnly testLibs. weld
71
73
testRuntimeOnly testLibs. wildFlyTxnClient
74
+ testRuntimeOnly jakartaLibs. jsonb
72
75
testRuntimeOnly libs. jackson
76
+ testRuntimeOnly libs. jacksonXml
77
+ testRuntimeOnly libs. jacksonJsr310
73
78
74
79
testAnnotationProcessor project( ' :hibernate-jpamodelgen' )
75
80
@@ -105,10 +110,8 @@ sourceSets {
105
110
}
106
111
}
107
112
108
- // resources inherently exclude sources
109
113
test {
110
114
resources {
111
- srcDir ' src/test/java'
112
115
srcDir ' src/test/resources'
113
116
srcDir ' src/test/bundles'
114
117
}
@@ -240,13 +243,16 @@ tasks.withType( Test.class ).each { test ->
240
243
test. jvmArgs( [' --add-opens' , ' java.base/java.security=ALL-UNNAMED' ] )
241
244
test. jvmArgs( [' --add-opens' , ' java.base/java.lang=ALL-UNNAMED' ] )
242
245
246
+ // Avoid Log4J2 classloader leaks:
247
+ test. jvmArgs( [' -Dlog4j2.disableJmx=true' ] )
248
+
243
249
test. beforeTest { descriptor ->
244
250
// println "Starting test: " + descriptor
245
251
}
246
252
}
247
253
248
254
// Tests with records
249
- if ( gradle . ext . javaVersions . test. release. asInt() >= 17 && gradle . ext . javaToolchainEnabled ) {
255
+ if ( jdkVersions . test. release. asInt() >= 17 && jdkVersions . explicit ) {
250
256
251
257
// Add a new source set, which contains tests that can run on JDK17+
252
258
sourceSets {
@@ -256,15 +262,15 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch
256
262
}
257
263
// Refer to the main test resources to avoid processing variables twice
258
264
resources {
259
- srcDir ' target/resources/test '
265
+ srcDirs tasks . processTestResources
260
266
}
261
267
}
262
268
}
263
269
264
270
// For the new source set, we need to configure the source and target version to 17
265
271
compileTestJava17Java {
266
272
javaCompiler = javaToolchains. compilerFor {
267
- languageVersion = gradle . ext . javaVersions . test. compiler
273
+ languageVersion = jdkVersions . test. compiler
268
274
}
269
275
sourceCompatibility = 17
270
276
targetCompatibility = 17
@@ -275,6 +281,7 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch
275
281
// The source set gets a custom configuration which extends the normal test implementation config
276
282
configurations {
277
283
testJava17Implementation. extendsFrom(testImplementation, testRuntimeOnly)
284
+ testJava17CompileOnly. extendsFrom(testCompileOnly)
278
285
}
279
286
280
287
// Add the output from src/main/java as dependency
@@ -287,14 +294,14 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch
287
294
// We execute the Java 17 tests in a custom test task
288
295
task testJava17(type : Test ) {
289
296
javaLauncher = javaToolchains. launcherFor {
290
- languageVersion = gradle . ext . javaVersions . test. launcher
297
+ languageVersion = jdkVersions . test. launcher
291
298
}
292
299
useJUnitPlatform()
293
300
testClassesDirs = sourceSets. testJava17. output. classesDirs
294
301
classpath = sourceSets. testJava17. runtimeClasspath
295
302
296
- if ( gradle . ext . javaVersions . test. launcher. asInt() >= 19 ) {
297
- logger. warn( " The version of Java bytecode that will be tested is not supported by Bytebuddy by default. " +
303
+ if ( jdkVersions . test. launcher. asInt() >= 19 ) {
304
+ logger. warn( " The version of Java bytecode that will be tested is not supported by Byte Buddy by default. " +
298
305
" Setting 'net.bytebuddy.experimental=true'." )
299
306
systemProperty ' net.bytebuddy.experimental' , true
300
307
}
@@ -305,9 +312,13 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch
305
312
check. dependsOn testJava17
306
313
}
307
314
308
- javadoc {
315
+ tasks . named( " javadoc" , Javadoc ) {
309
316
configure(options) {
310
- overview = ' src/main/javadoc/overview.html'
311
- stylesheetFile = new File (projectDir, ' src/main/javadoc/stylesheet.css' )
317
+ overview = rootProject. file( " shared/javadoc/overview.html" )
312
318
}
313
319
}
320
+
321
+ tasks. sourcesJar. dependsOn ' :hibernate-core:generateGraphParser'
322
+ tasks. sourcesJar. dependsOn ' :hibernate-core:generateHqlParser'
323
+ tasks. sourcesJar. dependsOn ' :hibernate-core:generateSqlScriptParser'
324
+ tasks. sourcesJar. dependsOn ' :hibernate-core:generateOrderingParser'
0 commit comments