@@ -87,8 +87,8 @@ class SpringRepositoriesExtension {
8787 addRepositories { }
8888 }
8989
90- def mavenRepositories ( condition ) {
91- if (condition) addRepositories { }
90+ def mavenRepositoriesFor ( version ) {
91+ addRepositories(version) { }
9292 }
9393
9494 def mavenRepositoriesExcludingBootGroup () {
@@ -100,9 +100,13 @@ class SpringRepositoriesExtension {
100100 }
101101
102102 private void addRepositories (action ) {
103- addCommercialRepository(" release" , false , " /spring-enterprise-maven-prod-local" , action)
104- if (this . version. endsWith(" -SNAPSHOT" )) {
105- addCommercialRepository(" snapshot" , true , " /spring-enterprise-maven-dev-local" , action)
103+ addRepositories(this . version, action)
104+ }
105+
106+ private void addRepositories (version , action ) {
107+ addCommercialRepositoryIfNecessary(" release" , false , " /spring-enterprise-maven-prod-local" , action)
108+ if (version. endsWith(" -SNAPSHOT" )) {
109+ addCommercialRepositoryIfNecessary(" snapshot" , true , " /spring-enterprise-maven-dev-local" , action)
106110 addOssRepository(" snapshot" , true , " /snapshot" , action)
107111 }
108112 }
@@ -113,7 +117,7 @@ class SpringRepositoriesExtension {
113117 addRepository(name, snapshot, url, action)
114118 }
115119
116- private void addCommercialRepository (id , snapshot , path , action ) {
120+ private void addCommercialRepositoryIfNecessary (id , snapshot , path , action ) {
117121 if (! " commercial" . equalsIgnoreCase(this . buildType)) return
118122 def name = " spring-commercial-" + id
119123 def url = fromEnv(" COMMERCIAL_%SREPO_URL" , id, " https://usw1.packages.broadcom.com" + path)
0 commit comments