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 + } + } + } + } +}