Skip to content

Commit

Permalink
fix(sbt): url resolution failures for sbt (#27856)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpriyasivakumar committed Mar 12, 2024
1 parent e74bbd4 commit d329c8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/modules/manager/sbt/extract.spec.ts
Expand Up @@ -576,7 +576,7 @@ describe('modules/manager/sbt/extract', () => {
replaceString: 'sbt.version=1.6.0',
versioning: 'semver',
extractVersion: '^v(?<version>\\S+)',
registryUrls: ['https://repo1.maven.org/maven2'],
registryUrls: [],
},
],
},
Expand Down
14 changes: 8 additions & 6 deletions lib/modules/manager/sbt/extract.ts
Expand Up @@ -395,12 +395,14 @@ export async function extractAllPackageFiles(
}
for (const pkg of packages) {
for (const dep of pkg.deps) {
if (proxyUrls.length > 0) {
dep.registryUrls!.unshift(...proxyUrls);
} else if (dep.depType === 'plugin') {
dep.registryUrls!.unshift(SBT_PLUGINS_REPO, SBT_MVN_REPO);
} else {
dep.registryUrls!.unshift(SBT_MVN_REPO);
if (dep.datasource !== GithubReleasesDatasource.id) {
if (proxyUrls.length > 0) {
dep.registryUrls!.unshift(...proxyUrls);
} else if (dep.depType === 'plugin') {
dep.registryUrls!.unshift(SBT_PLUGINS_REPO, SBT_MVN_REPO);
} else {
dep.registryUrls!.unshift(SBT_MVN_REPO);
}
}
}
}
Expand Down

0 comments on commit d329c8a

Please sign in to comment.