diff --git a/build.gradle b/build.gradle index 8b5fcd925c..763b3765ba 100644 --- a/build.gradle +++ b/build.gradle @@ -6,9 +6,9 @@ */ buildscript { - repositories { - mavenCentral() - } +// repositories { +// mavenCentral() +// } dependencies { classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0' @@ -23,7 +23,7 @@ buildscript { plugins { id 'org.hibernate.build.xjc-jakarta' version '1.0.2' apply false id 'org.hibernate.matrix-test' version '3.1.1' apply false - id 'org.hibernate.orm.database-service' version '1.0.0-SNAPSHOT' apply false + id 'org.hibernate.orm.database-service' apply false id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' id 'nu.studer.credentials' version '2.1' diff --git a/documentation/documentation.gradle b/documentation/documentation.gradle index 21b3b417c4..4742a8f742 100644 --- a/documentation/documentation.gradle +++ b/documentation/documentation.gradle @@ -52,17 +52,17 @@ dependencies { testImplementation 'org.apache.commons:commons-lang3:3.4' testImplementation 'org.osgi:org.osgi.core:4.3.1' - testImplementation libraries.mockito - testImplementation libraries.mockito_inline + testImplementation testLibs.mockito + testImplementation testLibs.mockitoInline - testRuntimeOnly libraries.wildfly_transaction_client - testRuntimeOnly(libraries.ehcache3) { + testRuntimeOnly testLibs.wildFlyTxnClient + testRuntimeOnly(libs.ehcache3) { capabilities { requireCapability 'org.ehcache.modules:ehcache-xml-jakarta' } } // Needed for JSON tests - testRuntimeOnly libraries.jackson + testRuntimeOnly libs.jackson } @@ -141,8 +141,8 @@ task buildTutorialZip(type: Zip) {task-> expand( version: project.version, slf4j: "1.7.5", - junit: project.junitVersion, - h2: project.h2Version + junit: testLibs.versions.junit4, + h2: dbLibs.versions.h2 ) tasks.renderGettingStartedGuides.dependsOn task } diff --git a/gradle/base-information.gradle b/gradle/base-information.gradle index b0026697fd..70fab5ea80 100644 --- a/gradle/base-information.gradle +++ b/gradle/base-information.gradle @@ -6,6 +6,7 @@ */ apply plugin: 'base' +apply plugin: 'org.hibernate.orm.build.env-project' buildscript { dependencies { @@ -21,81 +22,5 @@ buildscript { } } -ext { - ormVersionFile = file("${rootProject.projectDir}/gradle/version.properties") - - if ( project.hasProperty( 'releaseVersion' ) ) { - // Override during releases - ormVersion = new HibernateVersion( project.property( 'releaseVersion' ) as String, project ) - } - else { - ormVersion = HibernateVersion.fromFile(ormVersionFile, project) - } - - def version = System.getProperty( 'jakartaJpaVersion', '3.0.0' ) - jpaVersion = new JpaVersion('2.2') - jakartaJpaVersion = new JpaVersion(version) -} - group = 'org.hibernate.orm' version = project.ormVersion.fullName - -class JpaVersion { - /** The *normal* name (1.0, 2.0, ..) */ - final String name - - final String osgiName - - JpaVersion(String version){ - this.name = version - this.osgiName = version + ".0" - } - - @Override - String toString() { - return name - } -} - -class HibernateVersion { - final String fullName - final String majorVersion - final String family - - final String osgiVersion - - final boolean isSnapshot - - HibernateVersion(String fullName, Project project) { - this.fullName = fullName - - final String[] hibernateVersionComponents = fullName.split( '\\.' ) - this.majorVersion = hibernateVersionComponents[0] - this.family = hibernateVersionComponents[0] + '.' + hibernateVersionComponents[1] - - this.isSnapshot = fullName.endsWith( '-SNAPSHOT' ) - - this.osgiVersion = isSnapshot ? family + '.' + hibernateVersionComponents[2] + '.SNAPSHOT' : fullName - } - - static HibernateVersion fromFile(File file, Project project){ - def fullName = readVersionProperties(file) - return new HibernateVersion(fullName, project) - } - - private static String readVersionProperties(File file) { - if ( !file.exists() ) { - throw new GradleException( "Version file $file.canonicalPath does not exists" ) - } - Properties versionProperties = new Properties() - file.withInputStream { - stream -> versionProperties.load( stream ) - } - return versionProperties.hibernateVersion - } - - @Override - String toString() { - return this.fullName - } -} diff --git a/gradle/java-module.gradle b/gradle/java-module.gradle index 8b3fc61982..7dbb236ab7 100644 --- a/gradle/java-module.gradle +++ b/gradle/java-module.gradle @@ -56,58 +56,58 @@ if ( !project.description ) { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Configurations and Dependencies -dependencies { - implementation libraries.logging - compileOnly libraries.logging_annotations +dependencies { + implementation libs.logging + + compileOnly libs.loggingAnnotations // JUnit dependencies made up of: // * JUnit 5 // * the Jupiter engine which runs JUnit 5 based tests // * the "vintage" engine - which runs JUnit 3 and 4 based tests - testImplementation libraries.junit5_api - testImplementation libraries.junit5_jupiter - testImplementation libraries.junit5_params - testImplementation libraries.junit - testImplementation libraries.junit5_vintage + testImplementation testLibs.junit5Api + testImplementation testLibs.junit5Engine + testImplementation testLibs.junit5Params + testImplementation testLibs.junit4 + testImplementation testLibs.junit4Engine + testImplementation testLibs.assertjCore - testImplementation libraries.byteman - testImplementation libraries.byteman_install - testImplementation libraries.byteman_bmunit + testImplementation testLibs.byteman - testRuntimeOnly libraries.log4j2 - testRuntimeOnly libraries.byteBuddy + testRuntimeOnly testLibs.log4j2 + testRuntimeOnly libs.byteBuddy //Databases - testRuntimeOnly libraries.h2 - testRuntimeOnly libraries.derby - testRuntimeOnly libraries.hsqldb - testRuntimeOnly libraries.postgresql - testRuntimeOnly libraries.mssql - testRuntimeOnly libraries.informix - testRuntimeOnly libraries.cockroachdb - testRuntimeOnly libraries.oracle - testRuntimeOnly libraries.sybase + testRuntimeOnly dbLibs.h2 + testRuntimeOnly dbLibs.derby + testRuntimeOnly dbLibs.hsqldb + testRuntimeOnly dbLibs.postgresql + testRuntimeOnly dbLibs.mssql + testRuntimeOnly dbLibs.informix + testRuntimeOnly dbLibs.cockroachdb + testRuntimeOnly dbLibs.oracle + testRuntimeOnly dbLibs.sybase // Since both the DB2 driver and HANA have a package "net.jpountz" we have to add dependencies conditionally // This is due to the "no split-packages" requirement of Java 9+ if ( db.startsWith( 'db2' ) ) { - testRuntimeOnly libraries.db2 + testRuntimeOnly dbLibs.db2 } else if ( db.startsWith( 'hana' ) ) { - testRuntimeOnly libraries.hana + testRuntimeOnly dbLibs.hana } else if ( db.startsWith( 'mysql' ) || db.startsWith( 'tidb' ) ) { - testRuntimeOnly libraries.mysql + testRuntimeOnly dbLibs.mysql } else if ( db.startsWith( 'mariadb' ) ) { - testRuntimeOnly libraries.mariadb + testRuntimeOnly dbLibs.mariadb } - annotationProcessor libraries.logging_processor - annotationProcessor libraries.logging - annotationProcessor libraries.logging_annotations + annotationProcessor libs.loggingProcessor + annotationProcessor libs.logging + annotationProcessor libs.loggingAnnotations constraints { @@ -200,6 +200,7 @@ else { } } + task compile(dependsOn: [compileJava, processResources, compileTestJava, processTestResources] ) diff --git a/gradle/libraries.gradle b/gradle/libraries.gradle index 51730f28b9..3822afe767 100644 --- a/gradle/libraries.gradle +++ b/gradle/libraries.gradle @@ -5,214 +5,12 @@ * See the lgpl.txt file in the root directory or . */ -// build a map of the dependency artifacts to use. Allows centralized definition of the version of artifacts to -// use. In that respect it serves a role similar to in Maven -ext { - - junitVersion = '4.13.2' - junitVintageVersion = '5.8.2' - junit5Version = '5.8.2' - - h2Version = '2.1.210' - h2GisVersion = '2.0.0' -// h2Version = '1.4.197' -// h2GisVersion = '1.5.0' - bytemanVersion = '4.0.16' //Compatible with JDK16 - jnpVersion = '5.0.6.CR1' - - hibernateCommonsVersion = '6.0.0.Final' - hibernateValidatorJakartaVersion = '7.0.4.Final' - - cdiVersion = '2.0' - weldVersion = '3.1.5.Final' - jakartaWeldVersion = '4.0.1.SP1' - - byteBuddyVersion = '1.12.9' - - agroalVersion = '1.14' - - assertjVersion = '3.14.0' - - geolatteVersion = '1.8.2' - - shrinkwrapVersion = '1.2.6' - shrinkwrapDescriptorsVersion = '2.0.0' - - jodaTimeVersion = '2.3' - - jaxbApiVersion = '2.3.1' - // We can't upgrade JAXB in Karaf (yet), but fortunately everything works fine with the version built in Karaf - jaxbApiVersionOsgiRange = "[2.2,3)" - jaxbRuntimeVersion = '2.3.1' - jakartaJaxbRuntimeVersion = '3.0.2' - - //GraalVM - graalvmVersion = '22.0.0.2' - - antlrVersion = '4.9.1' - - micrometerVersion = '1.8.4' - - libraries = [ - // Ant - ant: 'org.apache.ant:ant:1.8.2', - - // Antlr - antlr: "org.antlr:antlr4:${antlrVersion}", - antlr4_runtime: "org.antlr:antlr4-runtime:${antlrVersion}", - - // Annotations - commons_annotations: "org.hibernate.common:hibernate-commons-annotations:${hibernateCommonsVersion}", - jandex: 'org.jboss:jandex:2.4.2.Final', - classmate: 'com.fasterxml:classmate:1.5.1', - - // Dom4J - dom4j: 'org.dom4j:dom4j:2.1.3@jar', - - // Byte Buddy - byteBuddy: "net.bytebuddy:byte-buddy:${byteBuddyVersion}", - - // jakarta - jakarta_jpa: "jakarta.persistence:jakarta.persistence-api:${project.jakartaJpaVersion}", - jakarta_jta: 'jakarta.transaction:jakarta.transaction-api:2.0.0', - jakarta_validation: 'jakarta.validation:jakarta.validation-api:3.0.0', - jakarta_jacc: 'jakarta.authorization:jakarta.authorization-api:2.0.0', - jakarta_interceptor: 'jakarta.interceptor:jakarta.interceptor-api:2.0.0', - jakarta_resource: 'jakarta.resource:jakarta.resource-api:2.0.0', - jakarta_jaxb_api: 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.1', - jakarta_jaxb_xjc: "org.glassfish.jaxb:jaxb-xjc:${jakartaJaxbRuntimeVersion}", - jakarta_jaxb_runtime: "org.glassfish.jaxb:jaxb-runtime:${jakartaJaxbRuntimeVersion}", - jakarta_cdi: 'jakarta.enterprise:jakarta.enterprise.cdi-api:3.0.0', - jakarta_weld: "org.jboss.weld.se:weld-se-shaded:${jakartaWeldVersion}", - jboss_jta_jakarta: "org.jboss.narayana.jta:narayana-jta-jakarta:5.11.2.Final", - jboss_tx_spi_jakarta: "org.jboss:jboss-transaction-spi-jakarta:7.6.1.Final", - jakarta_validator: "org.hibernate.validator:hibernate-validator:${hibernateValidatorJakartaVersion}", - jakarta_el: 'org.glassfish:jakarta.el:4.0.1', - jakarta_inject: 'jakarta.inject:jakarta.inject-api:2.0.0', - jakarta_jsonb: 'jakarta.json.bind:jakarta.json.bind-api:2.0.0', - - // javax - jpa: "javax.persistence:javax.persistence-api:${project.jpaVersion}", - jta: 'org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.1.1.Final', - jacc: 'org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.2.Final', - interceptor: 'javax.interceptor:javax.interceptor-api:1.2', - cdi: "javax.enterprise:cdi-api:${cdiVersion}", - weld: "org.jboss.weld.se:weld-se-shaded:${weldVersion}", - jaxb_api: "javax.xml.bind:jaxb-api:${jaxbApiVersion}", - jaxb_runtime: "org.glassfish.jaxb:jaxb-runtime:${jaxbRuntimeVersion}", - jaxb_xjc: "org.glassfish.jaxb:jaxb-xjc:${jaxbRuntimeVersion}", - // Note that jaxb2_basics is a set of tools on *top* of JAXB. - // See https://github.com/highsource/jaxb2-basics - jaxb2_basics: 'org.jvnet.jaxb2_commons:jaxb2-basics:0.12.0', - jaxb2_basics_ant: 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.12.0', - jboss_jta: "org.jboss.narayana.jta:narayana-jta:5.11.2.Final", - jboss_tx_spi: "org.jboss:jboss-transaction-spi:7.6.1.Final", - - - // logging - logging: 'org.jboss.logging:jboss-logging:3.4.3.Final', - logging_annotations: 'org.jboss.logging:jboss-logging-annotations:2.2.1.Final', - logging_processor: 'org.jboss.logging:jboss-logging-processor:2.2.1.Final', - - // jaxb task - - jackson: 'com.fasterxml.jackson.core:jackson-databind:2.13.0', - geolatte: "org.geolatte:geolatte-geom:${geolatteVersion}", - - // Animal Sniffer Ant Task and Java 1.6 API signature file - // not using 1.9 for the time being due to MANIMALSNIFFER-34 - animal_sniffer: 'org.codehaus.mojo:animal-sniffer-ant-tasks:1.13', - java16_signature: 'org.codehaus.mojo.signature:java16:1.0@signature', - - //Maven plugin framework - maven_core: 'org.apache.maven:maven-core:3.8.1', - maven_artifact: 'org.apache.maven:maven-artifact:3.0.5', - maven_plugin: 'org.apache.maven:maven-plugin-api:3.0.5', - maven_plugin_tools: 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.2', - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~ testing - - - junit5_api: "org.junit.jupiter:junit-jupiter-api:${junit5Version}", - junit5_jupiter: "org.junit.jupiter:junit-jupiter-engine:${junit5Version}", - junit5_params : "org.junit.jupiter:junit-jupiter-params:${junit5Version}", - junit: "junit:junit:${junitVersion}", - junit5_vintage: "org.junit.vintage:junit-vintage-engine:${junitVintageVersion}", - - log4j2: "org.apache.logging.log4j:log4j-core:2.17.1", - - byteman: "org.jboss.byteman:byteman:${bytemanVersion}", - byteman_install: "org.jboss.byteman:byteman-install:${bytemanVersion}", - byteman_bmunit: "org.jboss.byteman:byteman-bmunit:${bytemanVersion}", - h2: "com.h2database:h2:${h2Version}", - h2gis: "org.orbisgis:h2gis:${h2GisVersion}", - hsqldb: "org.hsqldb:hsqldb:2.6.1", - derby: "org.apache.derby:derby:10.14.2.0", - postgresql: 'org.postgresql:postgresql:42.2.16', - mysql: 'mysql:mysql-connector-java:8.0.27', - tidb: 'mysql:mysql-connector-java:8.0.27', - mariadb: 'org.mariadb.jdbc:mariadb-java-client:2.2.3', - cockroachdb: 'org.postgresql:postgresql:42.2.8', - - oracle: 'com.oracle.database.jdbc:ojdbc8:21.3.0.0', - mssql: 'com.microsoft.sqlserver:mssql-jdbc:7.2.1.jre8', - db2: 'com.ibm.db2:jcc:11.5.7.0', - hana: 'com.sap.cloud.db.jdbc:ngdbc:2.4.59', - sybase: 'net.sourceforge.jtds:jtds:1.3.1', - - jodaTime: "joda-time:joda-time:${jodaTimeVersion}", - - informix: 'com.ibm.informix:jdbc:4.10.12', - firebird: 'org.firebirdsql.jdbc:jaybird:4.0.3.java8', - xapool: "com.experlog:xapool:1.5.0", - mockito: 'org.mockito:mockito-core:4.3.1', - mockito_inline: 'org.mockito:mockito-inline:4.3.1', - - c3p0: "com.mchange:c3p0:0.9.5.5", - ehcache: "net.sf.ehcache:ehcache:2.10.6", - ehcache3: "org.ehcache:ehcache:3.10.0-alpha0", - jcache: "javax.cache:cache-api:1.0.0", - proxool: "proxool:proxool:0.8.3", - hikaricp: "com.zaxxer:HikariCP:3.2.0", - vibur: "org.vibur:vibur-dbcp:25.0", - agroal_api: "io.agroal:agroal-api:${agroalVersion}", - agroal_pool: "io.agroal:agroal-pool:${agroalVersion}", - micrometer: "io.micrometer:micrometer-core:1.6.1", - - atomikos: "com.atomikos:transactions:4.0.6", - atomikos_jta: "com.atomikos:transactions-jta:4.0.6", - - - assertj: "org.assertj:assertj-core:${assertjVersion}", - assertj_api: "org.assertj:assertj-core-api:${assertjVersion}", - - // Shrinkwrap - shrinkwrap_api: "org.jboss.shrinkwrap:shrinkwrap-api:${shrinkwrapVersion}", - shrinkwrap: "org.jboss.shrinkwrap:shrinkwrap-impl-base:${shrinkwrapVersion}", - - shrinkwrap_descriptors_api_javaee: "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-javaee:${shrinkwrapDescriptorsVersion}", - shrinkwrap_descriptors_impl_javaee: "org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-impl-javaee:${shrinkwrapDescriptorsVersion}", - - jboss_vfs: "org.jboss:jboss-vfs:3.2.11.Final", - wildfly_transaction_client : 'org.wildfly.transaction:wildfly-transaction-client-jakarta:2.0.0.Final', - jboss_ejb_spec_jar : 'org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec:1.0.0.Final', - jboss_annotation_spec_jar : 'org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.0.Final', - - graalvm_nativeimage : "org.graalvm.nativeimage:svm:${graalvmVersion}", - - //asciidoclet : 'org.asciidoctor:asciidoclet:1.+', - // Use the SNAPSHOT temporarily to validate asciidoclet's PR-91 - https://github.com/asciidoctor/asciidoclet/pull/91 - // - which does not seem to work anyway - // todo (6.0) : come back and verify whether this ever works - asciidoclet : 'org.asciidoctor:asciidoclet:1.5.7-SNAPSHOT' - ] -} - configurations.all { - resolutionStrategy.eachDependency { DependencyResolveDetails details -> - //Force the "byte buddy agent" version to match the Byte Buddy version we use, as Mockito might pull in a mismatched version transitively: - if (details.requested.group + ":" + details.requested.name == 'net.bytebuddy:byte-buddy-agent') { - details.useVersion byteBuddyVersion + resolutionStrategy.eachDependency { details -> + //Force the "byte buddy agent" version to match the Byte Buddy version + // we use, as Mockito might pull in a mismatched version transitively + if (details.requested.group == "net.bytebuddy" && details.requested.name == 'byte-buddy-agent') { + details.useVersion libs.versions.byteBuddy.get() } } } diff --git a/hibernate-agroal/hibernate-agroal.gradle b/hibernate-agroal/hibernate-agroal.gradle index 30a9b45574..1b75058101 100644 --- a/hibernate-agroal/hibernate-agroal.gradle +++ b/hibernate-agroal/hibernate-agroal.gradle @@ -10,12 +10,11 @@ description = 'Integration for Agroal as a ConnectionProvider for Hibernate ORM' apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { - implementation project( ':hibernate-core' ) - implementation libraries.agroal_api + var agroalVersion = "1.14" - runtimeOnly libraries.agroal_pool + implementation project( ':hibernate-core' ) + implementation "io.agroal:agroal-api:${agroalVersion}" testImplementation project( ':hibernate-testing' ) - testImplementation libraries.mockito - testImplementation libraries.mockito_inline + testRuntimeOnly "io.agroal:agroal-pool:${agroalVersion}" } diff --git a/hibernate-c3p0/hibernate-c3p0.gradle b/hibernate-c3p0/hibernate-c3p0.gradle index f3102abeb6..b0720799a4 100644 --- a/hibernate-c3p0/hibernate-c3p0.gradle +++ b/hibernate-c3p0/hibernate-c3p0.gradle @@ -11,13 +11,11 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { implementation project( ':hibernate-core' ) - implementation libraries.c3p0 - testImplementation project( ':hibernate-testing' ) - testImplementation libraries.mockito - testImplementation libraries.mockito_inline + implementation "com.mchange:c3p0:0.9.5.5" - testImplementation libraries.jakarta_validator - testRuntimeOnly libraries.jakarta_el + testImplementation project( ':hibernate-testing' ) + testImplementation libs.validator + testRuntimeOnly jakartaLibs.el if ( db.equalsIgnoreCase( 'oracle' ) ) { testRuntimeOnly libraries.oracle diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index c491ad0bbe..ec10b4794f 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -25,57 +25,53 @@ configurations { dependencies { - api libraries.jakarta_jpa - api libraries.jakarta_jta + api jakartaLibs.jpa + api jakartaLibs.jta - implementation libraries.jandex - implementation libraries.classmate - implementation libraries.commons_annotations + implementation libs.hcann + implementation libs.jandex + implementation libs.classmate + implementation libs.byteBuddy - implementation libraries.byteBuddy - implementation libraries.jakarta_jaxb_api - implementation libraries.jakarta_jaxb_runtime - implementation libraries.jakarta_inject + implementation jakartaLibs.jaxbApi + implementation jakartaLibs.jaxb + implementation jakartaLibs.inject - implementation libraries.antlr4_runtime + implementation libs.antlrRuntime - compileOnly libraries.jakarta_jacc - compileOnly libraries.jakarta_validation - compileOnly libraries.jakarta_cdi - - compileOnly libraries.jackson - compileOnly libraries.jakarta_jsonb + compileOnly jakartaLibs.jacc + compileOnly jakartaLibs.validation + compileOnly jakartaLibs.cdi + compileOnly jakartaLibs.jsonb + compileOnly libs.jackson testImplementation project(':hibernate-testing') testImplementation project(':hibernate-ant') - testImplementation libraries.shrinkwrap_api - testImplementation libraries.shrinkwrap - testImplementation libraries.shrinkwrap_descriptors_api_javaee - testImplementation libraries.shrinkwrap_descriptors_impl_javaee - testImplementation libraries.jakarta_jacc - testImplementation libraries.jakarta_validation - testImplementation libraries.jakarta_el - testImplementation( libraries.jakarta_validator ) { + testImplementation testLibs.shrinkwrapApi + testImplementation testLibs.shrinkwrap + testImplementation testLibs.shrinkwrapDescriptors + testImplementation testLibs.shrinkwrapDescriptorsApi + testImplementation jakartaLibs.cdi + testImplementation jakartaLibs.jacc + testImplementation jakartaLibs.validation + testImplementation jakartaLibs.el + testImplementation( libs.validator ) { // for test runtime transitive = true } - testImplementation libraries.jakarta_cdi - testImplementation libraries.mockito - testImplementation libraries.mockito_inline - testImplementation libraries.jodaTime - testImplementation libraries.assertj + testImplementation "joda-time:joda-time:2.3" - testRuntimeOnly libraries.byteBuddy - testRuntimeOnly libraries.jakarta_weld - testRuntimeOnly libraries.wildfly_transaction_client - testRuntimeOnly libraries.jackson + testRuntimeOnly libs.byteBuddy + testRuntimeOnly testLibs.weld + testRuntimeOnly testLibs.wildFlyTxnClient + testRuntimeOnly libs.jackson testAnnotationProcessor project( ':hibernate-jpamodelgen' ) - antlr libraries.antlr + antlr libs.antlr - xjc libraries.jakarta_jaxb_xjc - xjc libraries.jakarta_jaxb_runtime + xjc jakartaLibs.xjc + xjc jakartaLibs.jaxb xjc rootProject.fileTree(dir: 'patched-libs/jaxb2-basics', include: '*.jar') } diff --git a/hibernate-envers/hibernate-envers.gradle b/hibernate-envers/hibernate-envers.gradle index a4fa68f52b..e09a6151a6 100644 --- a/hibernate-envers/hibernate-envers.gradle +++ b/hibernate-envers/hibernate-envers.gradle @@ -13,17 +13,16 @@ apply plugin: 'org.hibernate.matrix-test' dependencies { api project( ':hibernate-core' ) - implementation libraries.jakarta_jaxb_api - implementation libraries.jakarta_jaxb_runtime - implementation libraries.commons_annotations - implementation libraries.jandex + implementation jakartaLibs.jaxbApi + implementation jakartaLibs.jaxb + implementation libs.hcann + implementation libs.jandex - compileOnly libraries.ant + compileOnly libs.ant annotationProcessor project( ':hibernate-jpamodelgen' ) testImplementation project( ':hibernate-testing' ) - testImplementation libraries.assertj } test { @@ -51,30 +50,6 @@ configurations { } } -jar { - manifest { - attributes( - // BND Plugin instructions (for OSGi): - 'Import-Package': [ - // TODO: Shouldn't have to explicitly list the JPA packages, but - // the plugin generates them with [1.0,2) versions. - "javax.persistence;version=\"${project.jpaVersion.osgiName}\"", - "javax.persistence.criteria;version=\"${project.jpaVersion.osgiName}\"", - "javax.persistence.metamodel;version=\"${project.jpaVersion.osgiName}\"", - "javax.persistence.spi;version=\"${project.jpaVersion.osgiName}\"", - // optionals - 'javax.naming;resolution:=optional', - 'org.apache.tools.ant;resolution:=optional', - // Temporarily support JTA 1.1 -- Karaf and other frameworks still - // use it. Without this, the plugin generates [1.2,2). - 'javax.transaction;version="[1.1,2)"', - // Also import every package referenced in the code - '*' - ].join( ',' ) - ) - } -} - sourcesJar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE } diff --git a/hibernate-graalvm/hibernate-graalvm.gradle b/hibernate-graalvm/hibernate-graalvm.gradle index ef392dd312..b92adda75f 100644 --- a/hibernate-graalvm/hibernate-graalvm.gradle +++ b/hibernate-graalvm/hibernate-graalvm.gradle @@ -12,7 +12,7 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { //No need for transitive dependencies: this is all just metadata to be used as companion jar. compileOnly project( ':hibernate-core' ) - compileOnly libraries.graalvm_nativeimage + compileOnly "org.graalvm.nativeimage:svm:22.0.0.2" testImplementation project( ':hibernate-core' ) } diff --git a/hibernate-hikaricp/hibernate-hikaricp.gradle b/hibernate-hikaricp/hibernate-hikaricp.gradle index a13160b7a7..ccbd1ff9f3 100644 --- a/hibernate-hikaricp/hibernate-hikaricp.gradle +++ b/hibernate-hikaricp/hibernate-hikaricp.gradle @@ -11,8 +11,7 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { implementation project( ':hibernate-core' ) - implementation libraries.hikaricp + implementation "com.zaxxer:HikariCP:3.2.0" testImplementation project( ':hibernate-testing' ) - testImplementation libraries.mockito } diff --git a/hibernate-jcache/hibernate-jcache.gradle b/hibernate-jcache/hibernate-jcache.gradle index 867fb23d9e..0f6377e658 100644 --- a/hibernate-jcache/hibernate-jcache.gradle +++ b/hibernate-jcache/hibernate-jcache.gradle @@ -5,13 +5,11 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { api project( ':hibernate-core' ) - api libraries.jcache + api "javax.cache:cache-api:1.0.0" testImplementation project( ':hibernate-testing' ) - testImplementation libraries.mockito - testImplementation libraries.mockito_inline - testRuntimeOnly(libraries.ehcache3) { + testRuntimeOnly(libs.ehcache3) { capabilities { requireCapability 'org.ehcache.modules:ehcache-xml-jakarta' } diff --git a/hibernate-micrometer/hibernate-micrometer.gradle b/hibernate-micrometer/hibernate-micrometer.gradle index 67adc6cf3d..421df4d70e 100644 --- a/hibernate-micrometer/hibernate-micrometer.gradle +++ b/hibernate-micrometer/hibernate-micrometer.gradle @@ -4,11 +4,9 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { implementation project( ':hibernate-core' ) - implementation libraries.micrometer + implementation "io.micrometer:micrometer-core:1.6.1" testImplementation project( ':hibernate-testing' ) - testImplementation libraries.mockito - testImplementation libraries.mockito_inline testAnnotationProcessor project( ':hibernate-jpamodelgen' ) } diff --git a/hibernate-platform/hibernate-platform.gradle b/hibernate-platform/hibernate-platform.gradle new file mode 100644 index 0000000000..a17d3538bc --- /dev/null +++ b/hibernate-platform/hibernate-platform.gradle @@ -0,0 +1,45 @@ +plugins { + id 'java-platform' +} + +apply from: rootProject.file( "gradle/base-information.gradle" ) +apply from: rootProject.file( "gradle/publishing-pom.gradle" ) + +dependencies { + constraints { + api project( ":hibernate-core" ) + api project( ":hibernate-testing" ) + api project( ":hibernate-envers" ) + api project( ":hibernate-spatial" ) + + api project( ":hibernate-agroal" ) + api project( ":hibernate-c3p0" ) + api project( ":hibernate-hikaricp" ) + api project( ":hibernate-proxool" ) + api project( ":hibernate-vibur" ) + + api project( ":hibernate-jcache" ) + + api project( ":hibernate-micrometer" ) + api project( ":hibernate-graalvm") + + api project( ":hibernate-jpamodelgen" ) + api project( ":hibernate-gradle-plugin" ) + api project( ":hibernate-enhance-maven-plugin" ) + api project( ":hibernate-ant" ) + + api jakartaLibs.jpa + api jakartaLibs.jta + + api libs.byteBuddy + api "net.bytebuddy:byte-buddy-agent:${libs.versions.byteBuddy}" + } +} + +publishing { + publications { + publishedArtifacts { + from components.javaPlatform + } + } +} \ No newline at end of file diff --git a/hibernate-proxool/hibernate-proxool.gradle b/hibernate-proxool/hibernate-proxool.gradle index 7a86abd380..80528f1d16 100644 --- a/hibernate-proxool/hibernate-proxool.gradle +++ b/hibernate-proxool/hibernate-proxool.gradle @@ -12,7 +12,7 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { implementation project( ':hibernate-core' ) - implementation libraries.proxool + implementation "proxool:proxool:0.8.3" testImplementation project( ':hibernate-testing' ) } diff --git a/hibernate-spatial/hibernate-spatial.gradle b/hibernate-spatial/hibernate-spatial.gradle index a3f6e6728b..9893eb068d 100644 --- a/hibernate-spatial/hibernate-spatial.gradle +++ b/hibernate-spatial/hibernate-spatial.gradle @@ -13,25 +13,25 @@ apply plugin: 'org.hibernate.matrix-test' dependencies { api project( ':hibernate-core' ) - api libraries.geolatte + api libs.geolatte - compileOnly libraries.postgresql + compileOnly dbLibs.postgresql testImplementation project( ':hibernate-testing' ) testImplementation project( ':hibernate-ant' ) testImplementation project( path: ':hibernate-core', configuration: 'tests' ) - testImplementation libraries.jakarta_validation - testImplementation libraries.jandex - testImplementation libraries.classmate - testImplementation libraries.jakarta_validator - testImplementation libraries.dom4j + testImplementation jakartaLibs.validation + testImplementation libs.jandex + testImplementation libs.classmate + testImplementation libs.validator + testImplementation 'org.dom4j:dom4j:2.1.3@jar' - testImplementation libraries.postgresql - testImplementation libraries.h2gis + testImplementation dbLibs.postgresql + testImplementation dbLibs.h2gis - testRuntimeOnly libraries.jakarta_el + testRuntimeOnly jakartaLibs.el testRuntimeOnly 'jaxen:jaxen:1.1' - testRuntimeOnly libraries.byteBuddy + testRuntimeOnly libs.byteBuddy } sourceSets.test.resources { diff --git a/hibernate-testing/hibernate-testing.gradle b/hibernate-testing/hibernate-testing.gradle index 4c5688ed48..b795083a3e 100644 --- a/hibernate-testing/hibernate-testing.gradle +++ b/hibernate-testing/hibernate-testing.gradle @@ -12,37 +12,36 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { api project( ':hibernate-core' ) - implementation libraries.commons_annotations - implementation libraries.jandex - - api libraries.junit - api libraries.junit5_api - api libraries.junit5_params + api testLibs.junit4 + api testLibs.junit5Api + api testLibs.junit5Params api 'org.hamcrest:hamcrest-all:1.3' - api libraries.assertj + api testLibs.assertjCore - api libraries.mockito - api libraries.mockito_inline + api testLibs.mockito + api testLibs.mockitoInline - api libraries.byteman - api libraries.byteman_install - api libraries.byteman_bmunit + api testLibs.byteman + api testLibs.bytemanInstall + api testLibs.bytemanBmunit - api libraries.xapool - api( libraries.jboss_tx_spi_jakarta ) { + api testLibs.xapool + api( testLibs.jbossTxSpi ) { transitive=false; } - api( libraries.jboss_jta_jakarta ) { + api( testLibs.jbossJta ) { transitive=false; } api 'javax.money:money-api:1.0.1' api 'org.javamoney:moneta:1.1' - api libraries.log4j2 + api testLibs.log4j2 - implementation libraries.wildfly_transaction_client + implementation libs.hcann + implementation libs.jandex + implementation testLibs.wildFlyTxnClient } tasks.checkstyleMain { diff --git a/hibernate-vibur/hibernate-vibur.gradle b/hibernate-vibur/hibernate-vibur.gradle index 2f267ef234..8b09cb006e 100644 --- a/hibernate-vibur/hibernate-vibur.gradle +++ b/hibernate-vibur/hibernate-vibur.gradle @@ -12,11 +12,10 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) dependencies { implementation project( ':hibernate-core' ) - implementation libraries.vibur + implementation "org.vibur:vibur-dbcp:25.0" testImplementation project( ':hibernate-testing' ) - testImplementation libraries.vibur + ':tests' + testImplementation "org.vibur:vibur-dbcp:25.0:tests" testImplementation 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2' - testImplementation libraries.mockito } diff --git a/local-build-plugins/build.gradle b/local-build-plugins/build.gradle index 896cd1fcbd..12094d59df 100644 --- a/local-build-plugins/build.gradle +++ b/local-build-plugins/build.gradle @@ -55,6 +55,14 @@ gradlePlugin { id = 'org.hibernate.orm.build.doc-pub' implementationClass = 'org.hibernate.orm.docs.DocumentationPublishingPlugin' } + envSettings { + id = 'org.hibernate.orm.build.env-settings' + implementationClass = 'org.hibernate.orm.env.EnvironmentSettingsPlugin' + } + envProject { + id = 'org.hibernate.orm.build.env-project' + implementationClass = 'org.hibernate.orm.env.EnvironmentProjectPlugin' + } } } diff --git a/local-build-plugins/src/main/java/org/hibernate/orm/env/EnvironmentProjectPlugin.java b/local-build-plugins/src/main/java/org/hibernate/orm/env/EnvironmentProjectPlugin.java new file mode 100644 index 0000000000..f91049dfe1 --- /dev/null +++ b/local-build-plugins/src/main/java/org/hibernate/orm/env/EnvironmentProjectPlugin.java @@ -0,0 +1,18 @@ +package org.hibernate.orm.env; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; + +/** + * @author Steve Ebersole + */ +public class EnvironmentProjectPlugin implements Plugin { + + @Override + public void apply(Project project) { + project.getExtensions().add( HibernateVersion.EXT_KEY, HibernateVersion.from( project ) ); + project.getExtensions().add( JpaVersion.EXT_KEY, JpaVersion.from( project ) ); + + project.getExtensions().add( "jpaVersion", new JpaVersion( "2.2" ) ); + } +} diff --git a/local-build-plugins/src/main/java/org/hibernate/orm/env/EnvironmentSettingsPlugin.java b/local-build-plugins/src/main/java/org/hibernate/orm/env/EnvironmentSettingsPlugin.java new file mode 100644 index 0000000000..9e7bdd5a67 --- /dev/null +++ b/local-build-plugins/src/main/java/org/hibernate/orm/env/EnvironmentSettingsPlugin.java @@ -0,0 +1,15 @@ +package org.hibernate.orm.env; + +import org.gradle.api.Plugin; +import org.gradle.api.initialization.Settings; + +/** + * @author Steve Ebersole + */ +public class EnvironmentSettingsPlugin implements Plugin { + + @Override + public void apply(Settings settings) { + settings.getExtensions().add( JpaVersion.EXT_KEY, JpaVersion.from( settings ) ); + } +} diff --git a/local-build-plugins/src/main/java/org/hibernate/orm/env/HibernateVersion.java b/local-build-plugins/src/main/java/org/hibernate/orm/env/HibernateVersion.java new file mode 100644 index 0000000000..c1551a708f --- /dev/null +++ b/local-build-plugins/src/main/java/org/hibernate/orm/env/HibernateVersion.java @@ -0,0 +1,111 @@ +/* + * 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 + */ +package org.hibernate.orm.env; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; +import java.util.Properties; +import java.util.function.Consumer; + +import org.gradle.api.Project; + +/** + * @author Steve Ebersole + */ +public class HibernateVersion { + public static final String EXT_KEY = "ormVersion"; + public static final String VERSION_KEY = "releaseVersion"; + public static final String RELATIVE_FILE = "gradle/version.properties"; + + private final String fullName; + private final String majorVersion; + private final String family; + + private final String osgiVersion; + + private final boolean isSnapshot; + + HibernateVersion(String fullName) { + this.fullName = fullName; + + final String[] hibernateVersionComponents = fullName.split( "\\." ); + this.majorVersion = hibernateVersionComponents[0]; + this.family = hibernateVersionComponents[0] + '.' + hibernateVersionComponents[1]; + + this.isSnapshot = fullName.endsWith( "-SNAPSHOT" ); + + this.osgiVersion = isSnapshot ? family + '.' + hibernateVersionComponents[2] + ".SNAPSHOT" : fullName; + } + + public String getFullName() { + return fullName; + } + + public String getMajorVersion() { + return majorVersion; + } + + public String getFamily() { + return family; + } + + public String getOsgiVersion() { + return osgiVersion; + } + + public boolean isSnapshot() { + return isSnapshot; + } + + public static HibernateVersion from(Project project) { + if ( project.hasProperty( VERSION_KEY ) ) { + final Object version = project.property( VERSION_KEY ); + if ( version != null ) { + return new HibernateVersion( (String) version ); + } + } + + final File versionFile = project.getRootProject().file( RELATIVE_FILE ); + final String fullName = readVersionProperties( versionFile ); + return new HibernateVersion( fullName ); + } + + private static String readVersionProperties(File file) { + if ( !file.exists() ) { + throw new RuntimeException( "Version file $file.canonicalPath does not exists" ); + } + + final Properties versionProperties = new Properties(); + withInputStream( file, (stream) -> { + try { + versionProperties.load( stream ); + } + catch (IOException e) { + throw new RuntimeException( "Unable to load properties from file - " + file.getAbsolutePath(), e ); + } + } ); + + return versionProperties.getProperty( "hibernateVersion" ); + } + + private static void withInputStream(File file, Consumer action) { + try ( final FileInputStream stream = new FileInputStream( file ) ) { + action.accept( stream ); + } + catch (IOException e) { + throw new RuntimeException( "Error reading file stream = " + file.getAbsolutePath(), e ); + } + } + + @Override + public String toString() { + return fullName; + } +} diff --git a/local-build-plugins/src/main/java/org/hibernate/orm/env/JpaVersion.java b/local-build-plugins/src/main/java/org/hibernate/orm/env/JpaVersion.java new file mode 100644 index 0000000000..503ef6bfbe --- /dev/null +++ b/local-build-plugins/src/main/java/org/hibernate/orm/env/JpaVersion.java @@ -0,0 +1,63 @@ +/* + * 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 + */ +package org.hibernate.orm.env; + +import java.util.Map; + +import org.gradle.StartParameter; +import org.gradle.api.Project; +import org.gradle.api.initialization.Settings; + +/** + * @author Steve Ebersole + */ +public class JpaVersion { + public static final String EXT_KEY = "jakartaJpaVersion"; + public static final String VERSION_KEY = "jakartaJpaVersion"; + public static final String DEFAULT_VERSION = "3.0.0"; + + private final String name; + private final String osgiName; + + public JpaVersion(String version) { + this.name = version; + this.osgiName = version + ".0"; + } + + public static JpaVersion from(Settings settings) { + return from( settings.getStartParameter() ); + } + + private static JpaVersion from(StartParameter startParameter) { + // the `-P` settings passed at command-line + final Map projectProperties = startParameter.getProjectProperties(); + final String projectProperty = projectProperties.get( VERSION_KEY ); + if ( projectProperty != null && !projectProperty.isEmpty() ) { + // use this one... + return new JpaVersion( projectProperty ); + } + + return new JpaVersion( System.getProperty( VERSION_KEY, DEFAULT_VERSION ) ); + } + + public static JpaVersion from(Project project) { + return from( project.getGradle().getStartParameter() ); + } + + public String getName() { + return name; + } + + public String getOsgiName() { + return osgiName; + } + + @Override + public String toString() { + return name; + } +} diff --git a/release/release.gradle b/release/release.gradle index a18666f391..0fd83e9a43 100644 --- a/release/release.gradle +++ b/release/release.gradle @@ -10,7 +10,6 @@ import groovy.json.JsonSlurper * See the lgpl.txt file in the root directory or . */ apply from: rootProject.file( 'gradle/module.gradle' ) -apply from: rootProject.file( 'gradle/libraries.gradle' ) apply plugin: 'org.hibernate.orm.build.doc-pub' apply plugin: 'idea' @@ -136,14 +135,14 @@ dependencies { jpamodelgen project( ':hibernate-jpamodelgen' ) javadocSources project( path: ':hibernate-jpamodelgen', configuration: 'javadocSources' ) - javadocClasspath libraries.logging_annotations - javadocClasspath libraries.jakarta_validation - javadocClasspath libraries.jakarta_cdi - javadocClasspath libraries.jakarta_jacc - javadocClasspath libraries.jakarta_jsonb - javadocClasspath libraries.ant - javadocClasspath libraries.postgresql - javadocClasspath libraries.jackson + javadocClasspath libs.loggingAnnotations + javadocClasspath jakartaLibs.validation + javadocClasspath jakartaLibs.cdi + javadocClasspath jakartaLibs.jacc + javadocClasspath jakartaLibs.jsonb + javadocClasspath libs.ant + javadocClasspath dbLibs.postgresql + javadocClasspath libs.jackson javadocClasspath gradleApi() } diff --git a/settings.gradle b/settings.gradle index dec931fd9c..ea86764d36 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,10 +18,16 @@ pluginManagement { } plugins { + id 'org.hibernate.orm.build.env-settings' id 'com.gradle.enterprise' version '3.8' id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.4.2' } +// version catalog support +// - https://docs.gradle.org/7.3.3/userguide/platforms.html#sub:central-declaration-of-dependencies +enableFeaturePreview("VERSION_CATALOGS") + + dependencyResolutionManagement { repositories { mavenCentral() @@ -42,6 +48,126 @@ dependencyResolutionManagement { } } } + + pluginManagement { + repositories { + gradlePluginPortal() + } + } + + versionCatalogs { + libs { + version( "antlr", "4.9.1" ) + version( "hcann", "6.0.0.Final" ) + version( "geolatte", "1.8.2" ) + version( "byteBuddy", "1.12.9" ) + + 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( "logging" ).to ( "org.jboss.logging", "jboss-logging" ).version( "3.4.3.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("org.jboss", "jandex" ).version( "2.4.2.Final" ) + alias( "classmate" ).to( "com.fasterxml", "classmate" ).version( "1.5.1" ) + + alias( "jackson" ).to ( "com.fasterxml.jackson.core", "jackson-databind" ).version( "2.13.0" ) + alias( "validator" ).to( "org.hibernate.validator", "hibernate-validator" ).version( "7.0.4.Final" ) + + alias( "ant" ).to( "org.apache.ant", "ant" ).version( "1.8.2" ) + + alias( "geolatte" ).to( "org.geolatte", "geolatte-geom" ).versionRef( "geolatte" ) + + alias( "ehcache3" ).to( "org.ehcache:ehcache:3.10.0-alpha0" ) + } + jakartaLibs { + version( "jaxbRuntime", "3.0.2" ) + + // `jakartaJpaVersion` comes from the `` plugin - accounting 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.0") + alias( "validation" ).to( "jakarta.validation", "jakarta.validation-api" ).version( "3.0.0" ) + alias( "jacc" ).to( "jakarta.authorization", "jakarta.authorization-api" ).version( "2.0.0" ) + alias( "cdi" ).to( "jakarta.enterprise", "jakarta.enterprise.cdi-api" ).version( "3.0.0" ) + alias( "jsonb" ).to( "jakarta.json.bind", "jakarta.json.bind-api" ).version( "2.0.0" ) + alias( "inject" ).to( "jakarta.inject", "jakarta.inject-api" ).version( "2.0.0" ) + alias( "jaxbApi" ).to( "jakarta.xml.bind", "jakarta.xml.bind-api" ).version( "3.0.1" ) + 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", "jakarta.el" ).version( "4.0.1" ) + } + testLibs { + version( "junit4", "4.13.2" ) + version( "junit5", "5.8.2" ) + version( "assertj", "3.14.0" ) + version( "mockito", "4.3.1" ) + version( "byteman", "4.0.16" ) + 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-jakarta" ).version( "5.11.2.Final" ) + alias( "jbossTxSpi" ).to( "org.jboss", "jboss-transaction-spi-jakarta" ).version( "7.6.1.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 { + version( "h2", "2.1.210" ) + version( "pgsql", "42.2.16" ) + version( "mysql", "8.0.27" ) + + alias( "h2" ).to( "com.h2database", "h2" ).versionRef( "h2" ) + alias( "h2gis" ).to( "org.orbisgis", "h2gis" ).version( "2.0.0" ) + alias( "hsqldb" ).to( "org.hsqldb", "hsqldb" ).version( "2.6.1" ) + alias( "derby" ).to( "org.apache.derby", "derby" ).version( "10.14.2.0" ) + alias( "postgresql" ).to( "org.postgresql", "postgresql" ).versionRef( "pgsql" ) + alias( "cockroachdb" ).to( "org.postgresql", "postgresql" ).version( "42.2.8" ) + alias( "mysql" ).to( "mysql", "mysql-connector-java" ).versionRef( "mysql" ) + alias( "tidb" ).to( "mysql", "mysql-connector-java" ).versionRef( "mysql" ) + alias( "mariadb" ).to( "org.mariadb.jdbc", "mariadb-java-client" ).version( "2.2.3" ) + alias( "oracle" ).to( "com.oracle.database.jdbc", "ojdbc8" ).version( "21.3.0.0" ) + alias( "mssql" ).to( "com.microsoft.sqlserver", "mssql-jdbc" ).version( "7.2.1.jre8" ) + alias( "db2" ).to( "com.ibm.db2", "jcc" ).version( "11.5.7.0" ) + alias( "hana" ).to( "com.sap.cloud.db.jdbc", "ngdbc" ).version( "2.4.59" ) + 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.3.java8" ) + } + 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' @@ -143,6 +269,8 @@ include 'hibernate-testing' include 'hibernate-envers' include 'hibernate-spatial' +include 'hibernate-platform' + include 'hibernate-community-dialects' include 'hibernate-c3p0' @@ -173,7 +301,6 @@ project(':hibernate-enhance-maven-plugin').projectDir = new File(rootProject.pro include 'hibernate-ant' project(':hibernate-ant').projectDir = new File(rootProject.projectDir, "tooling/hibernate-ant") -include 'hibernate-community-dialects' rootProject.children.each { project -> project.buildFileName = "${project.name}.gradle" @@ -181,4 +308,5 @@ rootProject.children.each { project -> assert project.buildFile.exists() assert project.buildFile.isFile() } +include 'hibernate-platform' diff --git a/tooling/hibernate-ant/hibernate-ant.gradle b/tooling/hibernate-ant/hibernate-ant.gradle index 5f3df2b09a..17632b9c7d 100644 --- a/tooling/hibernate-ant/hibernate-ant.gradle +++ b/tooling/hibernate-ant/hibernate-ant.gradle @@ -5,6 +5,6 @@ apply from: rootProject.file( 'gradle/published-java-module.gradle' ) apply plugin: 'version-injection' dependencies { - compileOnly libraries.ant + compileOnly libs.ant implementation project( ':hibernate-core' ) } \ No newline at end of file diff --git a/tooling/hibernate-enhance-maven-plugin/hibernate-enhance-maven-plugin.gradle b/tooling/hibernate-enhance-maven-plugin/hibernate-enhance-maven-plugin.gradle index ea7159db42..7d78e9cebb 100644 --- a/tooling/hibernate-enhance-maven-plugin/hibernate-enhance-maven-plugin.gradle +++ b/tooling/hibernate-enhance-maven-plugin/hibernate-enhance-maven-plugin.gradle @@ -22,20 +22,22 @@ processResources { dependencies { implementation( project(':hibernate-core') ) { transitive = false } - implementation( libraries.jakarta_jpa ) { transitive = false } - implementation( libraries.jakarta_jta ) { transitive = false } - implementation libraries.byteBuddy - implementation( libraries.maven_core ) { transitive = false } - implementation( libraries.maven_artifact ) { transitive = false } - implementation( libraries.maven_plugin ) { transitive = false } - implementation( libraries.maven_plugin_tools ) { transitive = false } + implementation( jakartaLibs.jpa ) { transitive = false } + implementation( jakartaLibs.jta ) { transitive = false } + implementation libs.byteBuddy + + implementation( mavenLibs.mavenCore ) { transitive = false } + implementation( mavenLibs.mavenArtifact ) { transitive = false } + implementation( mavenLibs.mavenPlugin ) { transitive = false } + implementation( mavenLibs.mavenPluginTools ) { transitive = false } + implementation 'org.codehaus.plexus:plexus-utils:3.0.24' implementation 'org.sonatype.plexus:plexus-build-api:0.0.7' - runtimeOnly libraries.maven_core - runtimeOnly libraries.maven_artifact - runtimeOnly libraries.maven_plugin - runtimeOnly libraries.maven_plugin_tools + runtimeOnly mavenLibs.mavenCore + runtimeOnly mavenLibs.mavenArtifact + runtimeOnly mavenLibs.mavenPlugin + runtimeOnly mavenLibs.mavenPluginTools } // Inject dependencies into plugin.xml @@ -48,12 +50,12 @@ task processPluginXml(type: Copy) { from "src/main/resources/META-INF/maven/plugin.xml" into "$processResources.destinationDir/META-INF/maven" filter(ReplaceTokens, tokens: ['version' : project.version, 'generated-dependencies' :\ - generateMavenDependency(libraries.jakarta_jpa)\ - + generateMavenDependency(libraries.antlr)\ - + generateMavenDependency(libraries.jakarta_jta)\ - + generateMavenDependency(libraries.commons_annotations)\ - + generateMavenDependency(libraries.byteBuddy)\ - + generateMavenDependency(libraries.logging)\ + generateMavenDependency(jakartaLibs.jpa)\ + + generateMavenDependency(libs.antlr)\ + + generateMavenDependency(jakartaLibs.jta)\ + + generateMavenDependency(libs.hcann)\ + + generateMavenDependency(libs.byteBuddy)\ + + generateMavenDependency(libs.logging)\ + generateMavenDependency("org.hibernate:hibernate-core:" + project.version)]) } @@ -69,6 +71,16 @@ def generateMavenDependency(String gradleDependency) { + "\n" } +def generateMavenDependency(Provider gradleDependencyProvider) { + String[] split = gradleDependencyProvider.get().toString().split(":") + return "\n"\ + + "\n " + split[0] + ""\ + + "\n " + split[1] + ""\ + + "\n " + split[2] + ""\ + + "\n jar"\ + + "\n" +} + // Writes pom.xml using merged Gradle dependency and MavenPom configuration. tasks.named('generatePomFileForPublishedArtifactsPublication') { pom.with { diff --git a/tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle b/tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle index 64a61fa639..bb62f59d30 100644 --- a/tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle +++ b/tooling/hibernate-gradle-plugin/hibernate-gradle-plugin.gradle @@ -22,7 +22,6 @@ plugins { apply from: rootProject.file( 'gradle/module.gradle' ) apply from: rootProject.file( 'gradle/javadoc.gradle' ) -apply from: rootProject.file( 'gradle/libraries.gradle' ) apply from: rootProject.file( 'gradle/releasable.gradle' ) description = "Gradle plugin for integrating Hibernate aspects into your build" @@ -34,10 +33,10 @@ ext { dependencies { implementation project( ':hibernate-core' ) - implementation libraries.byteBuddy + implementation libs.byteBuddy implementation gradleApi() // for Gradle - implementation libraries.jakarta_inject + implementation jakartaLibs.inject implementation localGroovy() } diff --git a/tooling/metamodel-generator/hibernate-jpamodelgen.gradle b/tooling/metamodel-generator/hibernate-jpamodelgen.gradle index 6a14f27d35..5401358266 100644 --- a/tooling/metamodel-generator/hibernate-jpamodelgen.gradle +++ b/tooling/metamodel-generator/hibernate-jpamodelgen.gradle @@ -19,18 +19,16 @@ ext { } dependencies { - implementation libraries.jakarta_jaxb_api - implementation libraries.jakarta_jaxb_runtime + implementation jakartaLibs.jaxbApi + implementation jakartaLibs.jaxb - xjc libraries.jakarta_jaxb_xjc - xjc libraries.jakarta_jaxb_runtime + xjc jakartaLibs.xjc + xjc jakartaLibs.jaxb xjc rootProject.fileTree(dir: 'patched-libs/jaxb2-basics', include: '*.jar') testImplementation project( ':hibernate-core' ) - testImplementation libraries.junit -// testImplementation libraries.jakarta_jpa - testImplementation libraries.jakarta_validation + testImplementation jakartaLibs.validation } sourceSets.main {