From f967b11e25097eccaacf0be24d976fb81a330ee0 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 19 May 2020 12:27:32 -0500 Subject: [PATCH] Work Around spring-gradle-plugins/dependency-management-plugin#277 --- build.gradle | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 73454d7..e7a30d7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import io.spring.nohttp.gradle.NoHttpCheckstylePlugin + buildscript { dependencies { classpath 'io.spring.gradle:spring-build-conventions:0.0.26.RELEASE' @@ -9,7 +11,7 @@ buildscript { } } -apply plugin: 'io.spring.convention.root' +apply plugin: NoHttpCheckstylePlugin apply plugin: 'io.spring.convention.springdependencymangement' apply plugin: 'io.spring.convention.maven' apply plugin: 'io.spring.convention.artifactory' @@ -21,6 +23,10 @@ artifacts { archives file('spring-session-bom.txt') } +repositories { + mavenCentral() +} + dependencyManagement { generatedPomCustomization { enabled = true @@ -76,11 +82,19 @@ task deployArtifacts { description = 'Deploys the artifacts to either Artifactory or Maven Central' } +def finalizeDeployArtifacts = project.task("finalizeDeployArtifacts") + if (version.matches(/^.*-RELEASE$/) || version.matches(/^.*-SR\d+$/)) { + if (project.hasProperty("ossrhUsername")) { + project.ext.nexusUsername = project.ossrhUsername + project.ext.nexusPassword = project.ossrhPassword + project.getPluginManager().apply("io.codearte.nexus-staging") + finalizeDeployArtifacts.dependsOn project.tasks.closeAndReleaseRepository + project.nexusStaging.packageGroup = 'org.springframework' + } + deployArtifacts.dependsOn uploadArchives } else { deployArtifacts.dependsOn artifactoryPublish } - -sonarqube.skipProject = true