401 lines
19 KiB
Groovy
401 lines
19 KiB
Groovy
/*
|
|
* 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.14'
|
|
id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.11.1'
|
|
}
|
|
|
|
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 {
|
|
def antlrVersion = "4.10.1"
|
|
def byteBuddyVersion = "1.14.7"
|
|
def classmateVersion = "1.5.1"
|
|
def geolatteVersion = "1.8.2"
|
|
def hcannVersion = "6.0.6.Final"
|
|
def jandexVersion = "3.0.5"
|
|
def jacksonVersion = "2.14.1"
|
|
def jbossLoggingVersion = "3.5.0.Final"
|
|
def jbossLoggingToolVersion = "2.2.1.Final"
|
|
|
|
def agroalVersion = "2.0"
|
|
def c3poVersion = "0.9.5.5"
|
|
def hikaricpVersion = "3.2.0"
|
|
def proxoolVersion = "0.8.3"
|
|
def viburVersion = "25.0"
|
|
|
|
def jcacheVersion = "1.0.0"
|
|
def ehcache3Version = "3.10.8"
|
|
|
|
def micrometerVersion = "1.10.4"
|
|
|
|
def hibernateValidatorVersion = "8.0.0.Final"
|
|
|
|
// these versions are referenced directly in build scripts
|
|
version( "byteBuddy", byteBuddyVersion )
|
|
version( "vibur", viburVersion )
|
|
|
|
library( "antlr", "org.antlr", "antlr4" ).version( antlrVersion )
|
|
library( "antlrRuntime", "org.antlr", "antlr4-runtime" ).version( antlrVersion)
|
|
|
|
library( "byteBuddy", "net.bytebuddy", "byte-buddy" ).version( byteBuddyVersion )
|
|
library( "byteBuddyAgent", "net.bytebuddy", "byte-buddy-agent" ).version( byteBuddyVersion )
|
|
|
|
library( "logging", "org.jboss.logging", "jboss-logging" ).version( jbossLoggingVersion )
|
|
library( "loggingAnnotations", "org.jboss.logging", "jboss-logging-annotations" ).version( jbossLoggingToolVersion )
|
|
library( "loggingProcessor", "org.jboss.logging", "jboss-logging-processor" ).version( jbossLoggingToolVersion )
|
|
|
|
library( "hcann", "org.hibernate.common", "hibernate-commons-annotations" ).version( hcannVersion )
|
|
library( "jandex", "io.smallrye", "jandex" ).version( jandexVersion )
|
|
library( "classmate", "com.fasterxml", "classmate" ).version( classmateVersion )
|
|
|
|
library( "jackson", "com.fasterxml.jackson.core", "jackson-databind" ).version( jacksonVersion )
|
|
library( "jacksonXml", "com.fasterxml.jackson.dataformat", "jackson-dataformat-xml" ).version( jacksonVersion )
|
|
library( "jacksonJsr310", "com.fasterxml.jackson.datatype", "jackson-datatype-jsr310" ).version( jacksonVersion )
|
|
library( "validator", "org.hibernate.validator", "hibernate-validator" ).version( hibernateValidatorVersion )
|
|
|
|
library( "agroal", "io.agroal", "agroal-api" ).version( agroalVersion )
|
|
library( "agroalPool", "io.agroal", "agroal-pool" ).version( agroalVersion )
|
|
|
|
library( "c3p0", "com.mchange", "c3p0" ).version( c3poVersion )
|
|
|
|
library( "hikaricp", "com.zaxxer", "HikariCP" ).version( hikaricpVersion )
|
|
|
|
library( "proxool", "proxool", "proxool" ).version( proxoolVersion )
|
|
|
|
library( "vibur", "org.vibur", "vibur-dbcp" ).version( viburVersion )
|
|
|
|
library( "geolatte", "org.geolatte", "geolatte-geom" ).version( geolatteVersion )
|
|
|
|
library( "jcache", "javax.cache", "cache-api" ).version( jcacheVersion )
|
|
library( "ehcache3", "org.ehcache", "ehcache" ).version( ehcache3Version )
|
|
|
|
library( "micrometer", "io.micrometer", "micrometer-core" ).version( micrometerVersion )
|
|
|
|
library( "ant", "org.apache.ant", "ant" ).version( "1.8.2" )
|
|
}
|
|
jakartaLibs {
|
|
// `jakartaJpaVersion` comes from the local-build-plugins to allow for command-line overriding of the JPA version to use
|
|
def jpaVersion = "${jakartaJpaVersion}"
|
|
|
|
def annotationVersion = "2.1.1"
|
|
def cdiVersion = "4.0.1"
|
|
def elVersion = "5.0.0"
|
|
def injectVersion = "2.0.1"
|
|
def interceptorsVersion = "2.1.0"
|
|
def jaccVersion = "2.1.0"
|
|
def jaxbApiVersion = "4.0.0"
|
|
def jaxbRuntimeVersion = "4.0.2"
|
|
def jsonbApiVersion = "3.0.0"
|
|
def jsonbRuntimeVersion = "3.0.2"
|
|
def jtaVersion = "2.0.1"
|
|
def validationVersion = "3.0.2"
|
|
def xjcVersion = jaxbRuntimeVersion
|
|
|
|
library( "jpa", "jakarta.persistence", "jakarta.persistence-api" ).version( jpaVersion )
|
|
library( "jta", "jakarta.transaction", "jakarta.transaction-api" ).version( jtaVersion )
|
|
|
|
library( "validation", "jakarta.validation", "jakarta.validation-api" ).version( validationVersion )
|
|
library( "jacc", "jakarta.authorization", "jakarta.authorization-api" ).version( jaccVersion )
|
|
library( "cdi", "jakarta.enterprise", "jakarta.enterprise.cdi-api" ).version( cdiVersion )
|
|
library( "annotation", "jakarta.annotation", "jakarta.annotation-api" ).version( annotationVersion )
|
|
library( "interceptors", "jakarta.interceptor", "jakarta.interceptor-api" ).version( interceptorsVersion )
|
|
library( "jsonbApi", "jakarta.json.bind", "jakarta.json.bind-api" ).version( jsonbApiVersion )
|
|
library( "jsonb", "org.eclipse", "yasson" ).version( jsonbRuntimeVersion )
|
|
library( "inject", "jakarta.inject", "jakarta.inject-api" ).version( injectVersion )
|
|
library( "jaxbApi", "jakarta.xml.bind", "jakarta.xml.bind-api" ).version( jaxbApiVersion )
|
|
library( "jaxb", "org.glassfish.jaxb", "jaxb-runtime" ).version( jaxbRuntimeVersion )
|
|
library( "xjc", "org.glassfish.jaxb", "jaxb-xjc" ).version( xjcVersion )
|
|
library( "el", "org.glassfish.expressly", "expressly" ).version( elVersion )
|
|
}
|
|
testLibs {
|
|
def junit5Version = "5.9.2"
|
|
def junit4Version = "4.13.2"
|
|
|
|
def assertjVersion = "3.22.0"
|
|
def bytemanVersion = "4.0.20"
|
|
def jbossJtaVersion = "7.0.0.Final"
|
|
def jbossTxSpiVersion = "8.0.0.Final"
|
|
def log4jVersion = "2.17.1"
|
|
def mockitoVersion = "5.2.0"
|
|
//Compatible with JDK20
|
|
def shrinkwrapVersion = "1.2.6"
|
|
def shrinkwrapDescriptorsVersion = "2.0.0"
|
|
def weldVersion = "4.0.1.SP1"
|
|
def wildFlyTxnClientVersion = "2.0.0.Final"
|
|
def xapoolVersion = "1.5.0"
|
|
|
|
library( "junit5Api", "org.junit.jupiter", "junit-jupiter-api" ).version( junit5Version )
|
|
library( "junit5Engine", "org.junit.jupiter", "junit-jupiter-engine" ).version( junit5Version )
|
|
library( "junit5Params", "org.junit.jupiter", "junit-jupiter-params" ).version( junit5Version )
|
|
library( "junit4Engine", "org.junit.vintage", "junit-vintage-engine" ).version( junit5Version )
|
|
library( "junit4", "junit", "junit" ).version( junit4Version )
|
|
|
|
library( "assertjCore", "org.assertj", "assertj-core" ).version( assertjVersion )
|
|
library( "assertjApi", "org.assertj", "assertj-core-api" ).version( assertjVersion )
|
|
|
|
library( "log4j2", "org.apache.logging.log4j", "log4j-core" ).version( log4jVersion )
|
|
|
|
library( "shrinkwrap", "org.jboss.shrinkwrap", "shrinkwrap-impl-base" ).version( shrinkwrapVersion )
|
|
library( "shrinkwrapApi", "org.jboss.shrinkwrap", "shrinkwrap-api" ).version( shrinkwrapVersion )
|
|
library( "shrinkwrapDescriptors", "org.jboss.shrinkwrap.descriptors", "shrinkwrap-descriptors-impl-javaee" ).version( shrinkwrapDescriptorsVersion )
|
|
library( "shrinkwrapDescriptorsApi", "org.jboss.shrinkwrap.descriptors", "shrinkwrap-descriptors-api-javaee" ).version( shrinkwrapDescriptorsVersion )
|
|
|
|
library( "byteman", "org.jboss.byteman", "byteman" ).version( bytemanVersion )
|
|
library( "bytemanInstall", "org.jboss.byteman", "byteman-install" ).version( bytemanVersion )
|
|
library( "bytemanBmunit", "org.jboss.byteman", "byteman-bmunit" ).version( bytemanVersion )
|
|
|
|
library( "mockito", "org.mockito", "mockito-core" ).version( mockitoVersion )
|
|
library( "mockitoInline", "org.mockito", "mockito-inline" ).version( mockitoVersion )
|
|
|
|
library( "xapool", "com.experlog", "xapool" ).version( xapoolVersion )
|
|
library( "jbossJta", "org.jboss.narayana.jta", "narayana-jta" ).version( jbossJtaVersion )
|
|
library( "jbossTxSpi", "org.jboss", "jboss-transaction-spi" ).version( jbossTxSpiVersion )
|
|
library( "wildFlyTxnClient", "org.wildfly.transaction", "wildfly-transaction-client-jakarta" ).version( wildFlyTxnClientVersion )
|
|
|
|
library( "weld", "org.jboss.weld.se", "weld-se-shaded" ).version( weldVersion )
|
|
}
|
|
dbLibs {
|
|
def h2Version = overrideableVersion( "gradle.libs.versions.h2", "2.2.220" )
|
|
|
|
def db2Version = "11.5.8.0"
|
|
// Latest Derby version 10.16.1.1 only supports JDK 17+, but 10.15.2 should be compatible
|
|
def derbyVersion = overrideableVersion( "gradle.libs.versions.derby", "10.15.2.0" )
|
|
def firebirdVersion = "4.0.8.java11"
|
|
def hanaVersion = "2.16.14"
|
|
def h2gisVersion = overrideableVersion( "gradle.libs.versions.h2gis", "2.1.0" )
|
|
def hsqldbVersion = overrideableVersion( "gradle.libs.versions.hsqldb", "2.7.2" )
|
|
def informixVersion = "4.10.12"
|
|
def mariadbVersion = "2.7.9"
|
|
def mssqlVersion = "12.2.0.jre11"
|
|
def mysqlVersion = "8.0.33"
|
|
def oracleVersion = "23.2.0.0"
|
|
def pgsqlVersion = "42.6.0"
|
|
def sybaseVersion = "1.3.1"
|
|
def tidbVersion = mysqlVersion
|
|
|
|
library( "h2", "com.h2database", "h2" ).version( h2Version )
|
|
library( "h2gis", "org.orbisgis", "h2gis" ).version( h2gisVersion )
|
|
library( "hsqldb", "org.hsqldb", "hsqldb" ).version( hsqldbVersion )
|
|
library( "derby", "org.apache.derby", "derby" ).version( derbyVersion )
|
|
library( "postgresql", "org.postgresql", "postgresql" ).version( pgsqlVersion )
|
|
library( "cockroachdb", "org.postgresql", "postgresql" ).version( pgsqlVersion )
|
|
library( "mysql", "com.mysql", "mysql-connector-j" ).version( mysqlVersion )
|
|
library( "tidb", "com.mysql", "mysql-connector-j" ).version( tidbVersion )
|
|
library( "mariadb", "org.mariadb.jdbc", "mariadb-java-client" ).version( mariadbVersion )
|
|
library( "oracle", "com.oracle.database.jdbc", "ojdbc11" ).version( oracleVersion )
|
|
library( "oracleXml", "com.oracle.database.xml", "xdb" ).version( oracleVersion )
|
|
library( "oracleXmlParser", "com.oracle.database.xml", "xmlparserv2" ).version( oracleVersion )
|
|
library( "mssql", "com.microsoft.sqlserver", "mssql-jdbc" ).version( mssqlVersion )
|
|
library( "db2", "com.ibm.db2", "jcc" ).version( db2Version )
|
|
library( "hana", "com.sap.cloud.db.jdbc", "ngdbc" ).version( hanaVersion )
|
|
library( "sybase", "net.sourceforge.jtds", "jtds" ).version( sybaseVersion )
|
|
library( "informix", "com.ibm.informix", "jdbc" ).version( informixVersion )
|
|
library( "firebird", "org.firebirdsql.jdbc", "jaybird" ).version( firebirdVersion )
|
|
}
|
|
mavenLibs {
|
|
def mavenCoreVersion = "3.8.1"
|
|
def mavenVersion = "3.0.5"
|
|
def mavenPluginToolsVersion = "3.2"
|
|
|
|
library( "mavenCore", "org.apache.maven", "maven-core" ).version( mavenCoreVersion )
|
|
library( "mavenArtifact", "org.apache.maven", "maven-artifact" ).version( mavenVersion )
|
|
library( "mavenPlugin", "org.apache.maven", "maven-plugin-api" ).version( mavenVersion )
|
|
library( "mavenPluginTools", "org.apache.maven.plugin-tools", "maven-plugin-annotations" ).version( mavenPluginToolsVersion )
|
|
}
|
|
}
|
|
}
|
|
|
|
String overrideableVersion(String settingName, String defaultVersion) {
|
|
String overridden = settings.ext.find( settingName )
|
|
if ( overridden != null ) {
|
|
return overridden
|
|
}
|
|
return defaultVersion
|
|
}
|
|
|
|
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'
|
|
|