Skip to content

Maven: fix forgetting repositories seen in earlier POMs#5931

Merged
jakecoffman merged 2 commits intomainfrom
jakecoffman/maven-short-term-memory-loss
Oct 20, 2022
Merged

Maven: fix forgetting repositories seen in earlier POMs#5931
jakecoffman merged 2 commits intomainfrom
jakecoffman/maven-short-term-memory-loss

Conversation

@jakecoffman
Copy link
Copy Markdown
Member

In project where POMs have grandparents (the POM's parent has a parent) we're seeing Dependabot forget about repositories it has seen in previous POMs. So it will start off well querying for a parent in a custom repository, but then forget about that and try to get the grandparent from Maven Central where it doesn't exist.

This PR adds tracking for URLs seen in POM files so that Dependabot can find the grandparent.

I was careful to keep the central repo URL out of the list of known URLs because if we have [custom1, central] in the first POM and [custom2, central] in the second, that would add up to [custom1, central, custom2] which is not the ideal order.

I tested this locally and it fixes #4168 and #5543. It also makes Dependabot "just work" in more cases now!

@jakecoffman jakecoffman merged commit 1fdc810 into main Oct 20, 2022
@jakecoffman jakecoffman deleted the jakecoffman/maven-short-term-memory-loss branch October 20, 2022 17:12
@pavera pavera mentioned this pull request Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependabot is unable to resolve a Maven property defined in a parent pom not located in Maven Central Unknown error in maven dependencies scan

2 participants