Skip to content

Commit

Permalink
fix(datasource/maven): Maven Central has no index.html (#32295)
Browse files Browse the repository at this point in the history
  • Loading branch information
aikebah authored Nov 10, 2024
1 parent c23effd commit 957d199
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/modules/datasource/maven/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ function mockGenericPackage(opts: MockOpts = {}) {
}

if (html) {
scope.get(`/${packagePath}/index.html`).reply(200, html);
scope.get(`/${packagePath}/`).reply(200, html);
} else if (html === null) {
scope.get(`/${packagePath}/index.html`).reply(404);
scope.get(`/${packagePath}/`).reply(404);
}

if (pom) {
Expand Down Expand Up @@ -129,7 +129,7 @@ describe('modules/datasource/maven/index', () => {
it('returns null when metadata is not found', async () => {
httpMock
.scope(baseUrl)
.get('/org/example/package/index.html')
.get('/org/example/package/')
.reply(404)
.get('/org/example/package/maven-metadata.xml')
.reply(404);
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/datasource/maven/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class MavenDatasource extends Datasource {
workingReleaseMap = {};
let retryEarlier = false;
try {
const indexUrl = getMavenUrl(dependency, repoUrl, 'index.html');
const indexUrl = getMavenUrl(dependency, repoUrl, '');
const res = await downloadHttpProtocol(this.http, indexUrl);
if (res) {
for (const line of res.body.split(newlineRegex)) {
Expand Down Expand Up @@ -171,7 +171,7 @@ export class MavenDatasource extends Datasource {
retryEarlier = true;
logger.debug(
{ dependency, err },
'Failed to get releases from index.html',
'Failed to get releases from package index page',
);
}
const cacheTTL = retryEarlier
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/sbt-package/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('modules/datasource/sbt-package/index', () => {
.reply(404, '')
.get('/maven2/com/example/empty/maven-metadata.xml')
.reply(404)
.get('/maven2/com/example/empty/index.html')
.get('/maven2/com/example/empty/')
.reply(404);

const res = await getPkgReleases({
Expand Down

0 comments on commit 957d199

Please # to comment.