HHH-15226 - Publish a Gradle platform (Maven Bom++) for Hibernate ORM

- plus use Gradle version catalogs as opposed to `libraries.gradle`
- dropped OSGi manifest entries for hibernate-envers - they were broken and we decided we no longer support OSGi
This commit is contained in:
Steve Ebersole 2022-04-22 18:40:06 -05:00
parent 5b85321bb9
commit 69e57404c6
29 changed files with 561 additions and 480 deletions

View File

@ -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'

View File

@ -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
}

View File

@ -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
}
}

View File

@ -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] )

View File

@ -5,214 +5,12 @@
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
// 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 <dependencyManagement> 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()
}
}
}

View File

@ -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}"
}

View File

@ -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

View File

@ -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')
}

View File

@ -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
}

View File

@ -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' )
}

View File

@ -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
}

View File

@ -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'
}

View File

@ -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' )
}

View File

@ -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
}
}
}

View File

@ -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' )
}

View File

@ -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 {

View File

@ -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 {

View File

@ -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
}

View File

@ -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'
}
}
}

View File

@ -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<Project> {
@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" ) );
}
}

View File

@ -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<Settings> {
@Override
public void apply(Settings settings) {
settings.getExtensions().add( JpaVersion.EXT_KEY, JpaVersion.from( settings ) );
}
}

View File

@ -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<InputStream> 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;
}
}

View File

@ -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<String, String> 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;
}
}

View File

@ -10,7 +10,6 @@ import groovy.json.JsonSlurper
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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()
}

View File

@ -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'

View File

@ -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' )
}

View File

@ -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</dependency>"
}
def generateMavenDependency(Provider<?> gradleDependencyProvider) {
String[] split = gradleDependencyProvider.get().toString().split(":")
return "\n<dependency>"\
+ "\n <groupId>" + split[0] + "</groupId>"\
+ "\n <artifactId>" + split[1] + "</artifactId>"\
+ "\n <version>" + split[2] + "</version>"\
+ "\n <type>jar</type>"\
+ "\n</dependency>"
}
// Writes pom.xml using merged Gradle dependency and MavenPom configuration.
tasks.named('generatePomFileForPublishedArtifactsPublication') {
pom.with {

View File

@ -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()
}

View File

@ -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 {