From ac4c90f63afd813c783eab72c69fc7e99dce38c2 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 17 Nov 2020 14:16:05 -0600 Subject: [PATCH] Add artifactoryUsername/Password --- build.gradle | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 497bd1b1..26b7b63f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,14 @@ buildscript { repositories { - maven { url 'https://repo.spring.io/plugins-release' } + maven { + url = 'https://repo.spring.io/plugins-release' + if (project.hasProperty('artifactoryUsername')) { + credentials { + username "$artifactoryUsername" + password "$artifactoryPassword" + } + } + } } dependencies { classpath "com.github.ben-manes:gradle-versions-plugin:0.17.0" @@ -226,3 +234,20 @@ artifacts { archives distZip archives schemaZip } + + +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 + } + } + } + } +}