From 94fe7bd387ff034466bcacb282fd47a51048280f Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 23 Feb 2022 13:50:32 -0800 Subject: [PATCH] Ensure authentication requirements are evaluated correctly. Methods defined outside Groovy/Gradle DSL cannot be invoked (called) inside Groovy/Gradle DSL. --- .../io/spring/gradle/convention/ArtifactoryPlugin.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 68b5b514..9de458e1 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy @@ -35,12 +35,14 @@ class ArtifactoryPlugin implements Plugin { project.plugins.apply('com.jfrog.artifactory') def artifactoryRepoKey = resolveRepositoryKey(project) + def authRequired = isAuthRequired(project) + project.artifactory { contextUrl = 'https://repo.spring.io' publish { repository { repoKey = artifactoryRepoKey - if (isAuthRequired(project)) { + if (authRequired) { username = artifactoryUsername password = artifactoryPassword }