Repository navigation
Keep DependencyListTest and ModuleHasDependencyTest from asking Maven Central directly - #207
Merged
Conversation
… Central directly Where CI names a mirror, as the Code Genome Project's builds do, two tests still reached repo.maven.apache.org directly. DependencyListTest#validateResolvable gives the recipe an LST whose only repository can't be reached. Its xml() source loads no Maven settings, and the downloader adds Maven Central behind that repository, so the test asked Central for com/test/test/maven-metadata.xml and its directory listing, and got 404s. Its context now leaves out Central and the local repository, so the pretend repository is the only one asked. The recipe still reports the MavenDownloadingException the test checks for. ModuleHasDependencyTest.WhenDependencyIsRequestedButNotResolved#mavenMatchesOnRequested forced empty settings, which keep the machine's own out but name no mirror, so spring-beans 6.0.0 and the POMs it needs came from Central directly. Like DependencyResolutionDiagnosticTest#maven since #206, it now uses settings that mirror only Central through MAVEN_CENTRAL_MIRROR_URL, _USERNAME and _PASSWORD when they are set, and the same empty settings when they are not. settingsMirroringOnlyCentral moves from DependencyResolutionDiagnosticTest to MavenCentralMirror so that both tests can use it.
jkschneider
deleted the
jkschneider/tests-reach-central-through-mirror
branch
October 25, 2026 00:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Code Genome Project builds this repository with
MAVEN_CENTRAL_MIRROR_URL,_USERNAMEand_PASSWORDnaming a mirror, and Maven settings that mirror everything through it. Since #206, two tests there still reachedrepo.maven.apache.orgdirectly, one connection each.DependencyListTest#validateResolvablegives the recipe an LST whose only repository,https://nonexistent, can't be reached. Itsxml()source loads no Maven settings, and the downloader adds Maven Central behind that repository, so the test asked Central forcom/test/test/maven-metadata.xmland its directory listing, and got 404s. Its context now leaves out Central and the local repository, so the pretend repository is the only one asked. The recipe still reports theMavenDownloadingExceptionthe test checks for.ModuleHasDependencyTest.WhenDependencyIsRequestedButNotResolved#mavenMatchesOnRequestedforced empty settings, which keep the machine's own out but name no mirror, sospring-beans6.0.0 and the POMs it needs came from Central directly. LikeDependencyResolutionDiagnosticTest#mavensince Check the diagnostic's report without naming Maven Central's or the plugin portal's URL #206, it now uses settings that mirror only Central throughMAVEN_CENTRAL_MIRROR_URLwhen that is set, and the same empty settings when it is not.settingsMirroringOnlyCentralmoves fromDependencyResolutionDiagnosticTesttoMavenCentralMirror, unchanged, so that both tests can use it.Locally, against the Code Genome Project's current snapshots,
DependencyListTest,ModuleHasDependencyTestandDependencyResolutionDiagnosticTestpass with and withoutMAVEN_CENTRAL_MIRROR_*set, 48 tests each. I also recorded every socket read and write of the test JVMs with Java Flight Recorder while those classes ran with the mirror set:main,validateResolvableandmavenMatchesOnRequestedeach opened a connection torepo.maven.apache.org.validateResolvablemakes none at all.With no mirror named,
mavenMatchesOnRequestedstill reaches Central directly, as before.