From 2e6861e80a507af9d36b68d3fe9c03ad11784208 Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Wed, 29 Mar 2023 10:12:01 +0200 Subject: [PATCH] [#1540] Use latest stable version of the orm gradle plugin --- build.gradle | 5 +++++ examples/native-sql-example/build.gradle | 9 ++++----- examples/session-example/build.gradle | 10 +++++----- gradle.properties | 7 ++++++- .../bytecode-enhancements-it/build.gradle | 10 +++++----- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index f60138192..8a8e3b6dc 100644 --- a/build.gradle +++ b/build.gradle @@ -55,6 +55,10 @@ ext { if ( !project.hasProperty('hibernateOrmVersion') ) { hibernateOrmVersion = '6.2.0.CR4' } + if ( !project.hasProperty( 'hibernateOrmGradlePluginVersion' ) ) { + // Same as ORM as default + hibernateOrmGradlePluginVersion = project.hibernateOrmVersion + } // For ORM, we need a parsed version (to get the family, ...) // For ORM, we need a parsed version (to get the family for the documentation during release). @@ -85,6 +89,7 @@ ext { testcontainersVersion = '1.17.5' logger.lifecycle "Hibernate ORM Version: " + project.hibernateOrmVersion + logger.lifecycle "Hibernate ORM Gradle plugin Version: " + project.hibernateOrmGradlePluginVersion logger.lifecycle "Vert.x Version: " + project.vertxVersion logger.lifecycle "Hibernate Reactive: " + project.version } diff --git a/examples/native-sql-example/build.gradle b/examples/native-sql-example/build.gradle index 1323a1d38..3016a1223 100644 --- a/examples/native-sql-example/build.gradle +++ b/examples/native-sql-example/build.gradle @@ -27,24 +27,23 @@ dependencies { buildscript { repositories { // Example: ./gradlew build -PenableMavenLocalRepo - if ( project.hasProperty('enableMavenLocalRepo') ) { + if ( project.hasProperty( 'enableMavenLocalRepo' ) ) { // Useful for local development, it should be disabled otherwise mavenLocal() } maven { - url = uri("https://plugins.gradle.org/m2/") + url 'https://plugins.gradle.org/m2/' } - mavenCentral() // Example: ./gradlew build -PenableJBossSnapshotsRep - if ( project.hasProperty('enableJBossSnapshotsRep') ) { + if ( project.hasProperty( 'enableJBossSnapshotsRep' ) ) { // Used only for testing with the latest Hibernate ORM snapshots. maven { url 'https://repository.jboss.org/nexus/content/repositories/snapshots' } } } dependencies { - classpath "org.hibernate.orm:hibernate-gradle-plugin:${hibernateOrmVersion}" + classpath "org.hibernate.orm:hibernate-gradle-plugin:${hibernateOrmGradlePluginVersion}" } } diff --git a/examples/session-example/build.gradle b/examples/session-example/build.gradle index 2b53bda46..a65e37f88 100644 --- a/examples/session-example/build.gradle +++ b/examples/session-example/build.gradle @@ -28,27 +28,27 @@ dependencies { buildscript { repositories { // Example: ./gradlew build -PenableMavenLocalRepo - if ( project.hasProperty('enableMavenLocalRepo') ) { + if ( project.hasProperty( 'enableMavenLocalRepo' ) ) { // Useful for local development, it should be disabled otherwise mavenLocal() } maven { - url = uri("https://plugins.gradle.org/m2/") + url 'https://plugins.gradle.org/m2/' } - mavenCentral() // Example: ./gradlew build -PenableJBossSnapshotsRep - if ( project.hasProperty('enableJBossSnapshotsRep') ) { + if ( project.hasProperty( 'enableJBossSnapshotsRep' ) ) { // Used only for testing with the latest Hibernate ORM snapshots. maven { url 'https://repository.jboss.org/nexus/content/repositories/snapshots' } } } dependencies { - classpath "org.hibernate.orm:hibernate-gradle-plugin:${hibernateOrmVersion}" + classpath "org.hibernate.orm:hibernate-gradle-plugin:${hibernateOrmGradlePluginVersion}" } } + // Hibernate Gradle plugin to enable bytecode enhancements apply plugin: 'org.hibernate.orm' diff --git a/gradle.properties b/gradle.properties index 44dfb522f..8dccee38e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -35,11 +35,16 @@ enableSonatypeOpenSourceSnapshotsRep = true #enableJBossSnapshotsRep = true # Enable the maven local repository (for local development when needed) when present (value ignored) -enableMavenLocalRepo = true +#enableMavenLocalRepo = true # Override default Hibernate ORM version hibernateOrmVersion = 6.2.0-SNAPSHOT +# Override default Hibernate ORM Gradle plugin version +# Using the stable version because I don't know how to configure the build to download the snapshot version from +# a remote repository +hibernateOrmGradlePluginVersion = 6.2.0.CR4 + # If set to true, skip Hibernate ORM version parsing (default is true, if set to null) # this is required when using intervals or weird versions or the build will fail #skipOrmVersionParsing = true diff --git a/integration-tests/bytecode-enhancements-it/build.gradle b/integration-tests/bytecode-enhancements-it/build.gradle index de8514427..038fa39f3 100644 --- a/integration-tests/bytecode-enhancements-it/build.gradle +++ b/integration-tests/bytecode-enhancements-it/build.gradle @@ -30,27 +30,27 @@ dependencies { buildscript { repositories { // Example: ./gradlew build -PenableMavenLocalRepo - if ( project.hasProperty('enableMavenLocalRepo') ) { + if ( project.hasProperty( 'enableMavenLocalRepo' ) ) { // Useful for local development, it should be disabled otherwise mavenLocal() } maven { - url = uri("https://plugins.gradle.org/m2/") + url 'https://plugins.gradle.org/m2/' } - mavenCentral() // Example: ./gradlew build -PenableJBossSnapshotsRep - if ( project.hasProperty('enableJBossSnapshotsRep') ) { + if ( project.hasProperty( 'enableJBossSnapshotsRep' ) ) { // Used only for testing with the latest Hibernate ORM snapshots. maven { url 'https://repository.jboss.org/nexus/content/repositories/snapshots' } } } dependencies { - classpath "org.hibernate.orm:hibernate-gradle-plugin:${hibernateOrmVersion}" + classpath "org.hibernate.orm:hibernate-gradle-plugin:${hibernateOrmGradlePluginVersion}" } } + // Hibernate Gradle plugin to enable bytecode enhancements apply plugin: 'org.hibernate.orm'