From 9f7a969a6e029e1af83b05f126b7800795ccb00a Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 15 Nov 2022 14:17:26 -0600 Subject: [PATCH] Fix Snapshot Deploy This commit merges a workaround to an issue in JFrog's Gradle plugin which causes SNAPSHOTs to be out of sync and thus prevents downloading. Closes gh-2177 --- buildSrc/build.gradle | 2 +- .../spring/gradle/convention/ArtifactoryPlugin.groovy | 11 +++++++++-- .../spring/gradle/convention/RootProjectPlugin.groovy | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 4a44d6b3..ff07b96a 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -66,7 +66,7 @@ dependencies { implementation 'io.spring.nohttp:nohttp-gradle:0.0.9' implementation 'net.sourceforge.htmlunit:htmlunit:2.55.0' implementation 'org.hidetake:gradle-ssh-plugin:2.10.1' - implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.24.20' + implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.29.0' implementation 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1' testImplementation platform('org.junit:junit-bom:5.8.1') diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy index 6e750b52..4412a868 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy @@ -18,6 +18,7 @@ package io.spring.gradle.convention import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.publish.maven.plugins.MavenPublishPlugin class ArtifactoryPlugin implements Plugin { @@ -37,8 +38,14 @@ class ArtifactoryPlugin implements Plugin { password = artifactoryPassword } } - defaults { - publications('mavenJava') + } + } + project.plugins.withType(MavenPublishPlugin) { + project.artifactory { + publish { + defaults { + publications('mavenJava') + } } } } diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/RootProjectPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/RootProjectPlugin.groovy index 3f7bada8..e71b32bc 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/RootProjectPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/RootProjectPlugin.groovy @@ -32,6 +32,7 @@ class RootProjectPlugin implements Plugin { pluginManager.apply(SchemaPlugin) pluginManager.apply(NoHttpPlugin) pluginManager.apply(SpringNexusPublishPlugin) + pluginManager.apply(ArtifactoryPlugin) pluginManager.apply("org.sonarqube") project.repositories.mavenCentral()