Repository navigation
Chore: use ApiRunner repositories in mvnval - #13648
Conversation
After apache#13469, mvnval can use ApiRunner's remote repositories directly. Remove the duplicate settings conversion and Central fallback. Keep the CLI local repository override ahead of settings.xml and test both default and configured remote repositories.
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean removal of duplicated repository-derivation logic. ApiRunner.createSession() already reads repositories from settings.xml via SettingsBuilder.convert() and calls session.withRemoteRepositories() (lines 647-657), making ValidateInvoker.derivedRepositories() redundant. The new parameterized test correctly validates that the CLI local repository overrides settings.xml and that remote repositories are derived from settings. @ResourceLock(SYSTEM_PROPERTIES) with try/finally is correctly applied.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean removal of a workaround made redundant by #13471. ApiRunner.newSession() already derives remote repositories from settings (including the Central fallback with snapshots disabled), so the deleted derivedRepositories() method was purely redundant — a good cleanup.
One minor observation on the new test:
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Name the test after its settings-or-Central behavior and local repository override. Both parameterized cases guard the session contract.
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier review — the naming/intent concern I raised about shouldUseStandaloneRepositories has been fully addressed.
The new shouldUseSettingsRepositoriesOrCentralWithRequestedLocalRepository parameterized test directly validates what this PR claims: (1) the CLI-requested local repository overrides settings.xml, and (2) remote repositories come from settings (or fall back to Central when none are declared). This is a genuine integration test that exercises ApiRunner.createSession() directly — far more useful than the previous stub-based test.
Code analysis confirms the simplification is correct: ApiRunner.newSession() already calls withRemoteRepositories(settingsRepos) where settingsRepos is derived from SettingsBuilder (which adds the Central fallback when no repositories are declared). The old derivedRepositories() method was re-implementing the exact same logic, making it purely redundant.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Targets Maven 4.1.0 (
master).After #13471, mvnval can use
ApiRunner's remote repositories directly.An unqualified
Sessionlookup could previously select mvnup's named provider, which supplies its own repositories. mvnval worked around this by rebuilding the repository list from settings.Remove that duplicate conversion and Central fallback. Keep the local repository override so
--local-repositorystill takes precedence oversettings.xml.