From 9fa2671cbc679103d1fe16a7088301f17fdf67fa Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Wed, 13 Oct 2021 10:24:56 +0200 Subject: [PATCH] Update to Gradle 7.2 --- gradle/java-module.gradle | 9 +--- gradle/published-java-module.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- hibernate-spatial/hibernate-spatial.gradle | 26 +++++----- .../hibernate-enhance-maven-plugin.gradle | 52 +++++++------------ 5 files changed, 37 insertions(+), 54 deletions(-) diff --git a/gradle/java-module.gradle b/gradle/java-module.gradle index bef4ad8c4a..036e450ee9 100644 --- a/gradle/java-module.gradle +++ b/gradle/java-module.gradle @@ -228,7 +228,7 @@ convention.findPlugin( JavaPluginConvention.class ).sourceSets.each { sourceSet final File toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar") if ( toolsJar.exists() ) { dependencies{ - testCompile files( toolsJar ) + testImplementation files( toolsJar ) } } @@ -254,17 +254,12 @@ if ( gradle.ext.javaToolchainEnabled ) { } } class HeapDumpPathProvider implements CommandLineArgumentProvider { -// @InputFile @OutputDirectory - @PathSensitive(PathSensitivity.RELATIVE) -// @Optional Provider path -// File path @Override Iterable asArguments() { ["-XX:HeapDumpPath=${path.get().asFile.absolutePath}"] -// ["-XX:HeapDumpPath=${path.absolutePath}"] } } @@ -280,7 +275,6 @@ tasks.withType( Test.class ).each { test -> test.jvmArgumentProviders.add( new HeapDumpPathProvider( path: project.layout.buildDirectory.dir("OOM-dump") ) -// new HeapDumpPathProvider( path: project.file( "${buildDir}/OOM-dump.hprof" ) ) ) test.jvmArgs += [ @@ -327,6 +321,7 @@ sourceSets { processTestResources { + duplicatesStrategy DuplicatesStrategy.INCLUDE inputs.property( "db", db ) doLast { copy { diff --git a/gradle/published-java-module.gradle b/gradle/published-java-module.gradle index 02ad2eac9d..f4f94a273a 100644 --- a/gradle/published-java-module.gradle +++ b/gradle/published-java-module.gradle @@ -33,7 +33,7 @@ publishing { from components.java } - relocationArtifacts( MavenPublication ) { + relocationPom( MavenPublication ) { pom { name = project.name + ' - relocation' groupId = 'org.hibernate' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7665b0fa93..a0f7639f7d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/hibernate-spatial/hibernate-spatial.gradle b/hibernate-spatial/hibernate-spatial.gradle index 0a3baeea5f..8819bf05c0 100644 --- a/hibernate-spatial/hibernate-spatial.gradle +++ b/hibernate-spatial/hibernate-spatial.gradle @@ -14,26 +14,26 @@ apply plugin: 'org.hibernate.matrix-test' dependencies { - compile project(':hibernate-core') - compile libraries.geolatte + api project(':hibernate-core') + api libraries.geolatte compileOnly libraries.postgresql - testCompile project(':hibernate-testing') - testCompile project(':hibernate-ant') - testCompile project( path: ':hibernate-core', configuration: 'tests' ) + testImplementation project(':hibernate-testing') + testImplementation project(':hibernate-ant') + testImplementation project( path: ':hibernate-core', configuration: 'tests' ) - testCompile libraries.jakarta_validation - testCompile libraries.jandex - testCompile libraries.classmate - testCompile libraries.jakarta_validator - testCompile libraries.dom4j + testImplementation libraries.jakarta_validation + testImplementation libraries.jandex + testImplementation libraries.classmate + testImplementation libraries.jakarta_validator + testImplementation libraries.dom4j testImplementation libraries.postgresql - testRuntime libraries.jakarta_el - testRuntime 'jaxen:jaxen:1.1' - testRuntime libraries.byteBuddy + testRuntimeOnly libraries.jakarta_el + testRuntimeOnly 'jaxen:jaxen:1.1' + testRuntimeOnly libraries.byteBuddy } sourceSets.test.resources { 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 5acbca3306..66c704612d 100644 --- a/tooling/hibernate-enhance-maven-plugin/hibernate-enhance-maven-plugin.gradle +++ b/tooling/hibernate-enhance-maven-plugin/hibernate-enhance-maven-plugin.gradle @@ -7,7 +7,7 @@ description = 'Enhance Plugin of the Hibernate project for use with Maven build system.' apply from: rootProject.file( 'gradle/published-java-module.gradle' ) -apply plugin: 'maven' +apply plugin: 'maven-publish' import org.apache.tools.ant.filters.ReplaceTokens @@ -69,40 +69,28 @@ def generateMavenDependency(String gradleDependency) { } // Writes pom.xml using merged Gradle dependency and MavenPom configuration. -processResources.doLast { - ext.pomDefinition = pom { - configurations { - // avoiding test dependencies in generated pom - compile - runtime - } - - project { - groupId project.group - packaging 'maven-plugin' - name 'Hibernate Enhance Maven Plugin' - description 'Enhance Plugin of the Hibernate project for use with Maven build system.' - properties { - 'project.build.sourceEncoding' 'UTF-8' +tasks.named('generatePomFileForPublishedArtifactsPublication') { + pom.with { + packaging 'maven-plugin' + name.set('Hibernate Enhance Maven Plugin') + description 'Enhance Plugin of the Hibernate project for use with Maven build system.' + properties.put( + 'project.build.sourceEncoding', 'UTF-8' + ) + // HHH-9679 --- build in pom{} conflicts with FactoryBuilderSupport#build so we write that portion of XML by hand + withXml { + asNode().appendNode('build').appendNode('plugins').appendNode('plugin').with { + appendNode('groupId', 'org.apache.maven.plugins') + appendNode('artifactId', 'maven-plugin-plugin') + appendNode('version', '3.2') + appendNode('configuration').appendNode('skipErrorNoDescriptorsFound', 'true') + appendNode('executions').appendNode('execution').with { + appendNode('id', 'mojo-descriptor') + appendNode('goals').appendNode('goal', 'descriptor') + } } } } - - // HHH-9679 --- build in pom{} conflicts with FactoryBuilderSupport#build so we write that portion of XML by hand - ext.pomDefinition.withXml { - asNode().appendNode('build').appendNode('plugins').appendNode('plugin').with { - appendNode('groupId', 'org.apache.maven.plugins') - appendNode('artifactId', 'maven-plugin-plugin') - appendNode('version', '3.2') - appendNode('configuration').appendNode('skipErrorNoDescriptorsFound', 'true') - appendNode('executions').appendNode('execution').with { - appendNode('id', 'mojo-descriptor') - appendNode('goals').appendNode('goal', 'descriptor') - } - } - } - - ext.pomDefinition.writeTo("$processResources.destinationDir/pom.xml") } processResources.dependsOn processPluginXml