From 05c0176b98778f2a0045350c9497559f577ab38d Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 17 Nov 2020 09:02:21 -0600 Subject: [PATCH] allprojects uses artifactoryUsername/Password --- build.gradle | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/build.gradle b/build.gradle index 98f7881dd2..623728adcb 100644 --- a/build.gradle +++ b/build.gradle @@ -43,3 +43,19 @@ subprojects { options.encoding = "UTF-8" } } + +if (project.hasProperty('artifactoryUsername') { + allprojects { project -> + project.repositories { repos -> + all { repo -> + if (!repo.url.toString().startsWith("https://repo.spring.io/")) { + return; + } + repo.credentials { + username = artifactoryUsername + password = artifactoryPassword + } + } + } + } +}