forked from hibernate/hibernate-orm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
362 lines (309 loc) · 17.8 KB
/
settings.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'localPluginRepository'
url = uri( "${gradle.gradleUserHomeDir}/tmp/plugins" )
}
}
includeBuild 'local-build-plugins'
}
plugins {
id 'org.hibernate.orm.build.env-settings'
id 'com.gradle.enterprise' version '3.13.4'
id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.11'
}
// version catalog support
// - https://docs.gradle.org/7.3.3/userguide/platforms.html#sub:central-declaration-of-dependencies
enableFeaturePreview("VERSION_CATALOGS")
dependencyResolutionManagement {
repositories {
mavenCentral()
// Needed for the RC versions of Jakarta Persistence
maven {
url "https://jakarta.oss.sonatype.org/content/repositories/releases/"
}
// Needed for the SNAPSHOT versions of Jakarta Persistence
maven {
url "https://jakarta.oss.sonatype.org/content/repositories/snapshots/"
}
//Allow loading additional dependencies from a local path;
//useful to load JDBC drivers which can not be distributed in public.
if (System.env['ADDITIONAL_REPO'] != null) {
flatDir {
dirs "${System.env.ADDITIONAL_REPO}"
}
}
}
pluginManagement {
repositories {
gradlePluginPortal()
}
}
versionCatalogs {
libs {
version( "antlr", "4.10.1" )
version( "hcann", "6.0.6.Final" )
version( "geolatte", "1.8.2" )
version( "byteBuddy", "1.12.18" )
version( "agroal", "2.0" )
version( "c3po", "0.9.5.5" )
version( "hikaricp", "3.2.0" )
version( "proxool", "0.8.3" )
version( "vibur", "25.0" )
version( "micrometer", "1.10.4" )
alias( "antlr" ).to( "org.antlr", "antlr4" ).versionRef( "antlr")
alias( "antlrRuntime" ).to( "org.antlr", "antlr4-runtime" ).versionRef( "antlr")
alias( "byteBuddy" ).to( "net.bytebuddy", "byte-buddy" ).versionRef( "byteBuddy" )
alias( "byteBuddyAgent" ).to( "net.bytebuddy", "byte-buddy-agent" ).versionRef( "byteBuddy" )
alias( "logging" ).to ( "org.jboss.logging", "jboss-logging" ).version( "3.5.0.Final" )
alias( "loggingAnnotations" ).to ( "org.jboss.logging", "jboss-logging-annotations" ).version( "2.2.1.Final" )
alias( "loggingProcessor" ).to ( "org.jboss.logging", "jboss-logging-processor" ).version( "2.2.1.Final" )
alias( "hcann" ).to( "org.hibernate.common", "hibernate-commons-annotations" ).versionRef( "hcann" )
alias( "jandex" ).to("io.smallrye", "jandex" ).version( "3.1.2" )
alias( "classmate" ).to( "com.fasterxml", "classmate" ).version( "1.5.1" )
alias( "jackson" ).to ( "com.fasterxml.jackson.core", "jackson-databind" ).version( "2.14.1" )
alias( "jacksonXml" ).to ( "com.fasterxml.jackson.dataformat", "jackson-dataformat-xml" ).version( "2.14.1" )
alias( "jacksonJsr310" ).to( "com.fasterxml.jackson.datatype", "jackson-datatype-jsr310" ).version( "2.14.1" )
alias( "validator" ).to( "org.hibernate.validator", "hibernate-validator" ).version( "8.0.0.Final" )
alias( "ant" ).to( "org.apache.ant", "ant" ).version( "1.8.2" )
alias( "geolatte" ).to( "org.geolatte", "geolatte-geom" ).versionRef( "geolatte" )
alias( "jcache" ).to( "javax.cache", "cache-api" ).version( "1.0.0" )
alias( "ehcache3" ).to( "org.ehcache:ehcache:3.10.8" )
alias( "agroal" ).to( "io.agroal", "agroal-api" ).versionRef( "agroal" )
alias( "agroalPool" ).to( "io.agroal", "agroal-pool" ).versionRef( "agroal" )
alias( "c3p0" ).to( "com.mchange", "c3p0" ).versionRef( "c3po" )
alias( "hikaricp" ).to( "com.zaxxer", "HikariCP" ).versionRef( "hikaricp" )
alias( "proxool" ).to( "proxool", "proxool" ).versionRef( "proxool" )
alias( "vibur" ).to( "org.vibur", "vibur-dbcp" ).versionRef( "vibur" )
alias( "micrometer" ).to ( "io.micrometer", "micrometer-core" ).versionRef( "micrometer" )
}
jakartaLibs {
version( "jaxbRuntime", "4.0.2" )
version( "jsonbRuntime", "3.0.2" )
// `jakartaJpaVersion` comes from the local-build-plugins to allow for command-line overriding of the JPA version to use
alias( "jpa" ).to( "jakarta.persistence", "jakarta.persistence-api" ).version( "${jakartaJpaVersion}" )
alias( "jta" ).to( "jakarta.transaction", "jakarta.transaction-api" ).version( "2.0.1")
alias( "validation" ).to( "jakarta.validation", "jakarta.validation-api" ).version( "3.0.2" )
alias( "jacc" ).to( "jakarta.authorization", "jakarta.authorization-api" ).version( "2.1.0" )
alias( "cdi" ).to( "jakarta.enterprise", "jakarta.enterprise.cdi-api" ).version( "4.0.1" )
alias( "annotation" ).to( "jakarta.annotation", "jakarta.annotation-api" ).version( "2.1.1" )
alias( "interceptors" ).to( "jakarta.interceptor", "jakarta.interceptor-api" ).version( "2.1.0" )
alias( "jsonbApi" ).to( "jakarta.json.bind", "jakarta.json.bind-api" ).version( "3.0.0" )
alias( "jsonb" ).to( "org.eclipse", "yasson" ).versionRef( "jsonbRuntime" )
alias( "inject" ).to( "jakarta.inject", "jakarta.inject-api" ).version( "2.0.1" )
alias( "jaxbApi" ).to( "jakarta.xml.bind", "jakarta.xml.bind-api" ).version( "4.0.0" )
alias( "jaxb" ).to( "org.glassfish.jaxb", "jaxb-runtime" ).versionRef( "jaxbRuntime" )
alias( "xjc" ).to( "org.glassfish.jaxb", "jaxb-xjc" ).versionRef( "jaxbRuntime" )
alias( "el" ).to( "org.glassfish.expressly", "expressly" ).version( "5.0.0" )
}
testLibs {
version( "junit4", "4.13.2" )
version( "junit5", "5.9.2" )
version( "assertj", "3.22.0" )
version( "mockito", "5.2.0" )
version( "byteman", "4.0.20" ) //Compatible with JDK20
version( "shrinkwrap", "1.2.6" )
version( "shrinkwrapDescriptors", "2.0.0" )
alias( "junit5Api" ).to( "org.junit.jupiter", "junit-jupiter-api" ).versionRef( "junit5" )
alias( "junit5Engine" ).to( "org.junit.jupiter", "junit-jupiter-engine" ).versionRef( "junit5" )
alias( "junit5Params" ).to( "org.junit.jupiter", "junit-jupiter-params" ).versionRef( "junit5" )
alias( "junit4Engine" ).to( "org.junit.vintage", "junit-vintage-engine" ).versionRef( "junit5" )
alias( "junit4" ).to( "junit", "junit" ).versionRef( "junit4" )
alias( "assertjCore" ).to( "org.assertj", "assertj-core" ).versionRef( "assertj" )
alias( "assertjApi" ).to( "org.assertj", "assertj-core-api" ).versionRef( "assertj" )
alias( "mockito" ).to( "org.mockito", "mockito-core" ).versionRef( "mockito" )
alias( "mockitoInline" ).to( "org.mockito", "mockito-inline" ).versionRef( "mockito" )
alias( "log4j2" ).to( "org.apache.logging.log4j", "log4j-core" ).version( "2.17.1" )
alias( "byteman" ).to ( "org.jboss.byteman", "byteman" ).versionRef("byteman" )
alias( "bytemanInstall" ).to ( "org.jboss.byteman", "byteman-install" ).versionRef("byteman" )
alias( "bytemanBmunit" ).to ( "org.jboss.byteman", "byteman-bmunit" ).versionRef("byteman" )
alias( "xapool" ).to( "com.experlog", "xapool" ).version( "1.5.0" )
alias( "shrinkwrap" ).to( "org.jboss.shrinkwrap", "shrinkwrap-impl-base" ).versionRef( "shrinkwrap" )
alias( "shrinkwrapApi" ).to( "org.jboss.shrinkwrap", "shrinkwrap-api" ).versionRef( "shrinkwrap" )
alias( "shrinkwrapDescriptors" ).to( "org.jboss.shrinkwrap.descriptors", "shrinkwrap-descriptors-impl-javaee" ).versionRef( "shrinkwrapDescriptors" )
alias( "shrinkwrapDescriptorsApi" ).to( "org.jboss.shrinkwrap.descriptors", "shrinkwrap-descriptors-api-javaee" ).versionRef( "shrinkwrapDescriptors" )
alias( "jbossJta" ).to( "org.jboss.narayana.jta", "narayana-jta" ).version( "6.0.0.Final" )
alias( "jbossTxSpi" ).to( "org.jboss", "jboss-transaction-spi" ).version( "8.0.0.Final" )
alias( "wildFlyTxnClient" ).to( "org.wildfly.transaction", "wildfly-transaction-client-jakarta" ).version( "2.0.0.Final" )
alias( "weld" ).to( "org.jboss.weld.se", "weld-se-shaded" ).version( "4.0.1.SP1" )
}
dbLibs {
String h2Version = settings.ext.find( "gradle.libs.versions.h2" )
if ( h2Version == null ) {
h2Version = "2.1.214"
}
String h2gisVersion = settings.ext.find( "gradle.libs.versions.h2gis" )
if ( h2gisVersion == null ) {
h2gisVersion = "2.2.0"
}
String hsqldbVersion = settings.ext.find( "gradle.libs.versions.hsqldb" )
if ( hsqldbVersion == null ) {
hsqldbVersion = "2.7.2"
}
String derbyVersion = settings.ext.find( "gradle.libs.versions.derby" )
if ( derbyVersion == null ) {
// Latest Derby version 10.16.1.1 only supports JDK 17+, but 10.15.2 should be compatible
derbyVersion = "10.15.2.0"
}
version( "h2", h2Version )
version( "h2gis", h2gisVersion )
version( "hsqldb", hsqldbVersion )
version( "derby", derbyVersion )
version( "pgsql", "42.6.0" )
version( "mysql", "8.0.33" )
version( "oracle", "23.2.0.0" )
version( "mariadb", "2.7.9" )
version( "mssql", "12.2.0.jre11" )
version( "db2", "11.5.8.0" )
version( "hana", "2.16.14" )
alias( "h2" ).to( "com.h2database", "h2" ).versionRef( "h2" )
alias( "h2gis" ).to( "org.orbisgis", "h2gis" ).versionRef( "h2gis" )
alias( "hsqldb" ).to( "org.hsqldb", "hsqldb" ).versionRef( "hsqldb" )
alias( "derby" ).to( "org.apache.derby", "derby" ).versionRef( "derby" )
alias( "postgresql" ).to( "org.postgresql", "postgresql" ).versionRef( "pgsql" )
alias( "cockroachdb" ).to( "org.postgresql", "postgresql" ).versionRef( "pgsql" )
alias( "mysql" ).to( "com.mysql", "mysql-connector-j" ).versionRef( "mysql" )
alias( "tidb" ).to( "com.mysql", "mysql-connector-j" ).versionRef( "mysql" )
alias( "mariadb" ).to( "org.mariadb.jdbc", "mariadb-java-client" ).versionRef( "mariadb" )
alias( "oracle" ).to( "com.oracle.database.jdbc", "ojdbc11" ).versionRef( "oracle" )
alias( "oracleXml" ).to( "com.oracle.database.xml", "xdb" ).versionRef( "oracle" )
alias( "oracleXmlParser" ).to( "com.oracle.database.xml", "xmlparserv2" ).versionRef( "oracle" )
alias( "mssql" ).to( "com.microsoft.sqlserver", "mssql-jdbc" ).versionRef( "mssql" )
alias( "db2" ).to( "com.ibm.db2", "jcc" ).versionRef( "db2" )
alias( "hana" ).to( "com.sap.cloud.db.jdbc", "ngdbc" ).versionRef( "hana" )
alias( "sybase" ).to( "net.sourceforge.jtds", "jtds" ).version( "1.3.1" )
alias( "informix" ).to( "com.ibm.informix", "jdbc" ).version( "4.10.12" )
alias( "firebird" ).to( "org.firebirdsql.jdbc", "jaybird" ).version( "4.0.8.java11" )
}
mavenLibs {
alias( "mavenCore" ).to( "org.apache.maven", "maven-core" ).version( "3.8.1" )
alias( "mavenArtifact" ).to( "org.apache.maven", "maven-artifact" ).version( "3.0.5" )
alias( "mavenPlugin" ).to( "org.apache.maven", "maven-plugin-api" ).version( "3.0.5" )
alias( "mavenPluginTools" ).to( "org.apache.maven.plugin-tools", "maven-plugin-annotations" ).version( "3.2" )
}
}
}
rootProject.name = 'hibernate-orm'
apply from: file( 'gradle/gradle-enterprise.gradle' )
if ( !JavaVersion.current().java11Compatible ) {
throw new GradleException( "Gradle must be run with Java 11 or later" )
}
buildCache {
local {
// do not use local build cache for CI jobs, period!
enabled = !settings.ext.isCiEnvironment
}
remote(HttpBuildCache) {
enabled = true
push = settings.ext.populateRemoteBuildCache
url = 'https://ge.hibernate.org/cache/'
}
}
gradle.ext.baselineJavaVersion = JavaLanguageVersion.of( 11 )
// Gradle does bytecode transformation on tests.
// You can't use bytecode higher than what Gradle supports, even with toolchains.
def GRADLE_MAX_SUPPORTED_BYTECODE_VERSION = 17
// If either 'main.jdk.version' or 'test.jdk.version' is set, enable the toolchain and use the selected jdk.
// If only one property is set, the other defaults to the baseline Java version (11).
// Note that when toolchain is enabled, you also need to specify
// the location of the selected jdks
// (auto-download and auto-detect are disabled in gradle.properties).
//
// Example (with SDKMAN):
// ./gradlew build -Ptest.jdk.version=15 \
// -Porg.gradle.java.installations.paths=$SDKMAN_CANDIDATES_DIR/java/15.0.1-open,$SDKMAN_CANDIDATES_DIR/java/8
if ( hasProperty( 'main.jdk.version' ) || hasProperty( 'test.jdk.version' ) ) {
// Testing a particular JDK version
// Gradle doesn't support all JDK versions unless we use toolchains
gradle.ext.javaToolchainEnabled = true
gradle.ext.javaVersions = [
main: [
compiler: JavaLanguageVersion.of( hasProperty( 'main.jdk.version' )
? getProperty( 'main.jdk.version' ) : gradle.ext.baselineJavaVersion.asInt() ),
release: gradle.ext.baselineJavaVersion
],
test: [
compiler: JavaLanguageVersion.of( hasProperty( 'test.jdk.version' )
? getProperty( 'test.jdk.version' ) : gradle.ext.baselineJavaVersion.asInt() )
]
]
def testCompilerVersion = gradle.ext.javaVersions.test.compiler
if ( testCompilerVersion.asInt() > GRADLE_MAX_SUPPORTED_BYTECODE_VERSION ) {
logger.warn( "[WARN] Gradle does not support bytecode version '${testCompilerVersion}'." +
" Forcing test bytecode to version ${GRADLE_MAX_SUPPORTED_BYTECODE_VERSION}." )
gradle.ext.javaVersions.test.release = JavaLanguageVersion.of( GRADLE_MAX_SUPPORTED_BYTECODE_VERSION )
}
else {
gradle.ext.javaVersions.test.release = testCompilerVersion
}
gradle.ext.javaVersions.test.launcher = testCompilerVersion
}
else {
// Not testing a particular JDK version: we will use the same JDK used to run Gradle.
// We disable toolchains for convenience, so that anyone can just run the build with their own JDK
// without any additional options and without downloading the whole JDK.
gradle.ext.javaToolchainEnabled = false
def gradleJdkVersion = JavaLanguageVersion.of( JavaVersion.current().getMajorVersion() )
if ( gradleJdkVersion.asInt() > GRADLE_MAX_SUPPORTED_BYTECODE_VERSION ) {
logger.warn( "[WARN] Gradle does not support this JDK, because it is too recent; build is likely to fail." +
" To avoid failures, you should use an older Java version when running Gradle, and rely on toolchains." +
" To that end, specify the version of Java you want to run tests with using property 'test.jdk.version'," +
" and specify the path to JDK8 *and* a JDK of the test version using property 'org.gradle.java.installations.paths'." +
" Example:" +
"./gradlew build -Ptest.jdk.version=15 -Porg.gradle.java.installations.paths=\$SDKMAN_CANDIDATES_DIR/java/15.0.1-open,\$SDKMAN_CANDIDATES_DIR/java/8" )
}
gradle.ext.javaVersions = [
main: [
compiler: gradleJdkVersion,
release: gradle.ext.baselineJavaVersion
],
test: [
compiler: gradleJdkVersion,
release: JavaLanguageVersion.of(
Math.min( GRADLE_MAX_SUPPORTED_BYTECODE_VERSION, gradleJdkVersion.asInt() ) ),
launcher: gradleJdkVersion
]
]
}
logger.lifecycle "Java versions for main code: " + gradle.ext.javaVersions.main
logger.lifecycle "Java versions for tests: " + gradle.ext.javaVersions.test
include 'hibernate-core'
include 'hibernate-testing'
include 'hibernate-envers'
include 'hibernate-spatial'
include 'hibernate-platform'
include 'hibernate-community-dialects'
include 'hibernate-c3p0'
include 'hibernate-proxool'
include 'hibernate-hikaricp'
include 'hibernate-vibur'
include 'hibernate-agroal'
include 'hibernate-jcache'
include 'hibernate-micrometer'
include 'hibernate-graalvm'
include 'hibernate-integrationtest-java-modules'
include 'documentation'
include 'release'
include 'metamodel-generator'
project(':metamodel-generator').projectDir = new File(rootProject.projectDir, "tooling/metamodel-generator")
project(':metamodel-generator').name = 'hibernate-jpamodelgen'
include 'hibernate-gradle-plugin'
project(':hibernate-gradle-plugin').projectDir = new File(rootProject.projectDir, "tooling/hibernate-gradle-plugin")
include 'hibernate-enhance-maven-plugin'
project(':hibernate-enhance-maven-plugin').projectDir = new File(rootProject.projectDir, "tooling/hibernate-enhance-maven-plugin")
include 'hibernate-ant'
project(':hibernate-ant').projectDir = new File(rootProject.projectDir, "tooling/hibernate-ant")
rootProject.children.each { project ->
project.buildFileName = "${project.name}.gradle"
assert project.projectDir.isDirectory()
assert project.buildFile.exists()
assert project.buildFile.isFile()
}
include 'hibernate-platform'