feat: fetch Maven metadata from specified repositories
https://github.com/google/osv-scanner/issues/1045
There are repositories defined in a Maven pom.xml. When looking for an artifact, these repositories are searched one by one until the artifact is found. Maven Central is the default registry to try at the last.
To support this behaviour, this PR:
- makes
MavenRegistryAPIClienthost a list of registries besides the default registry - adds
UpdateRegistriestoDependencyClientto update the registries - adds a new flag to specify the default maven registry for
fix - add new experimental options to
scanto align with what we have forfix
Currently, running resolution with native data source is a bit slow and this is due to Maven resolver calling MatchingVersion for all requirements. There is work in progress to improve this and I believe this would speed the resolution.
TODO:
- still need to update documentation for new options/flags
- update deps.dev Maven resolver for mutil-registry resolution
Codecov Report
Attention: Patch coverage is 67.02703% with 61 lines in your changes missing coverage. Please review.
Project coverage is 68.43%. Comparing base (
a5a1e29) to head (b0295ef). Report is 169 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1286 +/- ##
==========================================
+ Coverage 68.09% 68.43% +0.34%
==========================================
Files 183 183
Lines 17498 17606 +108
==========================================
+ Hits 11915 12049 +134
+ Misses 4942 4895 -47
- Partials 641 662 +21
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I mark this PR to draft - the registries should not be added when importing dependencies, but that is now done by MergeParents for all cases.