From 9d43a430e9193eaaa115f79781ea3e3405255384 Mon Sep 17 00:00:00 2001 From: Guillermo Calvo Date: Tue, 24 Oct 2023 18:19:00 +0200 Subject: [PATCH] Fix dependencies (resolve versions via global dependency management) --- .../internal/GrailsCentralPublishGradlePlugin.groovy | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/org/grails/gradle/plugin/publishing/internal/GrailsCentralPublishGradlePlugin.groovy b/src/main/groovy/org/grails/gradle/plugin/publishing/internal/GrailsCentralPublishGradlePlugin.groovy index d4e076ae..ade90d83 100644 --- a/src/main/groovy/org/grails/gradle/plugin/publishing/internal/GrailsCentralPublishGradlePlugin.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/publishing/internal/GrailsCentralPublishGradlePlugin.groovy @@ -244,13 +244,14 @@ BINTRAY_KEY=key } - // simply remove dependencies without a version - // version-less dependencies are handled with dependencyManagement + // fix dependencies without a version + // resolve versions via global dependency management // see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions + final versions = project.dependencyManagement.dependencyManagementContainer.globalDependencyManagement.versions pomNode.dependencies.dependency.findAll { it.version.text().isEmpty() }.each { - it.replaceNode {} + it.appendNode('version', versions["${it.groupId.text()}:${it.artifactId.text()}"]) } } }