Ensure authentication requirements are evaluated correctly.

Methods defined outside Groovy/Gradle DSL cannot be invoked (called) inside Groovy/Gradle DSL.
This commit is contained in:
John Blum
2022-02-23 13:50:32 -08:00
parent 0db8ff3fb8
commit 94fe7bd387

View File

@@ -35,12 +35,14 @@ class ArtifactoryPlugin implements Plugin<Project> {
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
}