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 9de458e1..5015dec0 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy @@ -34,6 +34,7 @@ class ArtifactoryPlugin implements Plugin { project.plugins.apply('com.jfrog.artifactory') + // (Externally-defined) Methods cannot be invoked inside the Groovy/Gradle DSL. def artifactoryRepoKey = resolveRepositoryKey(project) def authRequired = isAuthRequired(project) @@ -54,10 +55,12 @@ class ArtifactoryPlugin implements Plugin { } } + @SuppressWarnings("all") private boolean isAuthRequired(Project project) { - project.hasProperty('artifactoryUsername') + project?.hasProperty('artifactoryUsername') } + @SuppressWarnings("all") private String resolveRepositoryKey(Project project) { boolean isSnapshot = Utils.isSnapshot(project);