Use Maven Central mirror in Java Maven integration tests#22046
Open
mario-campos wants to merge 1 commit into
Open
Use Maven Central mirror in Java Maven integration tests#22046mario-campos wants to merge 1 commit into
mario-campos wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates Java Maven integration tests to prefer the Google Cloud Storage (GCS) mirror for Maven Central, aiming to reduce dependency download latency/flakiness in CI by redirecting Maven (and buildless Maven dependency resolution) away from the default Maven Central endpoints.
Changes:
- Add per-test
settings.xmlfiles that define a Maven Central mirror pointing athttps://maven-central.storage-download.googleapis.com/maven2/. - Update many integration-test
test.pyharnesses to passLGTM_INDEX_MAVEN_SETTINGS_FILEso Maven uses the new settings. - For some buildless tests where
settings.xmlis itself under test, modifypom.xmlrepository definitions and adjust expected fetch-output files accordingly.
Show a summary per file
| File | Description |
|---|---|
| java/ql/integration-tests/java/maven-wrapper/test.py | Pass LGTM_INDEX_MAVEN_SETTINGS_FILE to use per-test Maven mirror config. |
| java/ql/integration-tests/java/maven-wrapper/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-wrapper/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-wrapper-source-only/test.py | Pass LGTM_INDEX_MAVEN_SETTINGS_FILE to use per-test Maven mirror config. |
| java/ql/integration-tests/java/maven-wrapper-source-only/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-wrapper-source-only/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-wrapper-script-only/test.py | Pass LGTM_INDEX_MAVEN_SETTINGS_FILE to use per-test Maven mirror config. |
| java/ql/integration-tests/java/maven-wrapper-script-only/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-wrapper-script-only/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-wrapper-missing-properties/test.py | Pass settings path while keeping autobuild mode. |
| java/ql/integration-tests/java/maven-wrapper-missing-properties/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-wrapper-missing-properties/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample/test.py | Pass LGTM_INDEX_MAVEN_SETTINGS_FILE to use per-test mirror config. |
| java/ql/integration-tests/java/maven-sample/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-sample/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample-xml-mode-smart/test.py | Preserve XML mode while adding Maven settings override. |
| java/ql/integration-tests/java/maven-sample-xml-mode-smart/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample-xml-mode-disabled/test.py | Preserve XML mode while adding Maven settings override. |
| java/ql/integration-tests/java/maven-sample-xml-mode-disabled/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample-xml-mode-byname/test.py | Preserve XML mode while adding Maven settings override. |
| java/ql/integration-tests/java/maven-sample-xml-mode-byname/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample-xml-mode-all/test.py | Preserve XML mode while adding Maven settings override. |
| java/ql/integration-tests/java/maven-sample-xml-mode-all/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-sample-xml-mode-all/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample-xml-mode-all-gbk-encoding/test.py | Preserve XML mode while adding Maven settings override. |
| java/ql/integration-tests/java/maven-sample-xml-mode-all-gbk-encoding/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-sample-xml-mode-all-gbk-encoding/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample-small-xml-files/test.py | Add settings override while generating large XML fixtures. |
| java/ql/integration-tests/java/maven-sample-small-xml-files/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-sample-small-xml-files/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample-large-xml-files/test.py | Add settings override while generating large XML fixtures. |
| java/ql/integration-tests/java/maven-sample-large-xml-files/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-sample-extract-properties/test.py | Preserve properties-extraction flag while adding Maven settings override. |
| java/ql/integration-tests/java/maven-sample-extract-properties/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-sample-extract-properties/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-multimodule-test-java-version/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-multimodule-test-java-version/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-java8-java11-dependency/test.py | Preserve toolchains override while adding Maven settings override. |
| java/ql/integration-tests/java/maven-java8-java11-dependency/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-java8-java11-dependency/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-java16-with-higher-jdk/test.py | Preserve toolchains override while adding Maven settings override. |
| java/ql/integration-tests/java/maven-java16-with-higher-jdk/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-java16-with-higher-jdk/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-execution-specific-java-version/test.py | Preserve toolchains override while adding Maven settings override. |
| java/ql/integration-tests/java/maven-execution-specific-java-version/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-execution-specific-java-version/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-enforcer/test.py | Pass LGTM_INDEX_MAVEN_SETTINGS_FILE to use per-test mirror config. |
| java/ql/integration-tests/java/maven-enforcer/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-enforcer/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-enforcer-single-version/test.py | Pass LGTM_INDEX_MAVEN_SETTINGS_FILE to use per-test mirror config. |
| java/ql/integration-tests/java/maven-enforcer-single-version/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-enforcer-single-version/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-enforcer-multiple-versions/test.py | Pass LGTM_INDEX_MAVEN_SETTINGS_FILE to use per-test mirror config. |
| java/ql/integration-tests/java/maven-enforcer-multiple-versions/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-enforcer-multiple-versions/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-download-failure/test.py | Add settings override to Maven download-failure scenario. |
| java/ql/integration-tests/java/maven-download-failure/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-download-failure/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/maven-add-exports-module-flags/test.py | Preserve toolchains override while adding Maven settings override. |
| java/ql/integration-tests/java/maven-add-exports-module-flags/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/maven-add-exports-module-flags/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/buildless-snapshot-repository/test.py | Add settings override to buildless snapshot-repo scenario. |
| java/ql/integration-tests/java/buildless-snapshot-repository/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/buildless-proxy-maven/test.py | Add settings override to buildless Maven proxy scenario. |
| java/ql/integration-tests/java/buildless-proxy-maven/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/buildless-proxy-maven/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/buildless-proxy-maven/buildless-fetches.expected | Update expected buildless fetch URLs to reflect mirror usage for some artifacts. |
| java/ql/integration-tests/java/buildless-maven/pom.xml | For buildless tests, redefine central repository to use GCS mirror. |
| java/ql/integration-tests/java/buildless-maven/maven-fetches.expected | Update expected Maven “Downloaded from central” URLs to GCS mirror. |
| java/ql/integration-tests/java/buildless-maven/buildless-fetches.expected | Update expected buildless fetch URLs to reflect mirror usage for some artifacts. |
| java/ql/integration-tests/java/buildless-maven-tolerate-unavailable-dependency/test.py | Add settings override to buildless unavailable-dependency scenario. |
| java/ql/integration-tests/java/buildless-maven-tolerate-unavailable-dependency/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/buildless-maven-timeout/test.py | Add settings override while preserving buildless timeout configuration. |
| java/ql/integration-tests/java/buildless-maven-timeout/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/buildless-maven-timeout/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/buildless-maven-multimodule/test.py | Add settings override to buildless multimodule scenario. |
| java/ql/integration-tests/java/buildless-maven-multimodule/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/buildless-maven-multimodule/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/buildless-maven-multimodule/buildless-fetches.expected | Update expected buildless fetch URLs to reflect mirror usage for some artifacts. |
| java/ql/integration-tests/java/buildless-maven-mirrorof/settings.xml | Update mirror definition under test to use GCS mirror URL. |
| java/ql/integration-tests/java/buildless-maven-mirrorof/settings-xml.expected | Update expected pretty-printed settings output for new mirror. |
| java/ql/integration-tests/java/buildless-maven-mirrorof/pom.xml | For buildless mirror-of tests, redefine central repository to use GCS mirror. |
| java/ql/integration-tests/java/buildless-maven-mirrorof/maven-fetches.expected | Update expected Maven download logs to new mirror ID/URL. |
| java/ql/integration-tests/java/buildless-maven-mirrorof/buildless-fetches.expected | Update expected buildless fetch URLs to reflect GCS mirror. |
| java/ql/integration-tests/java/buildless-maven-existing-settings-xml/pom.xml | For buildless “existing settings.xml” tests, redefine central repository to use GCS mirror. |
| java/ql/integration-tests/java/buildless-maven-existing-settings-xml/maven-fetches.expected | Update expected Maven “Downloaded from central” URLs to GCS mirror. |
| java/ql/integration-tests/java/buildless-maven-existing-settings-xml/buildless-fetches.expected | Update expected buildless fetch URLs to reflect mirror usage for some artifacts. |
| java/ql/integration-tests/java/buildless-maven-executable-war/test.py | Add settings override to buildless executable-war scenario. |
| java/ql/integration-tests/java/buildless-maven-executable-war/source_archive.expected | Include settings.xml in archived sources expectation. |
| java/ql/integration-tests/java/buildless-maven-executable-war/settings.xml | New Maven settings defining GCS mirror for central. |
| java/ql/integration-tests/java/buildless-maven-executable-war/buildless-fetches.expected | Update expected buildless fetch URLs to reflect mirror usage for some artifacts. |
| java/ql/integration-tests/java/buildless-inherit-trust-store/test.py | Add settings override while preserving custom trust-store configuration. |
| java/ql/integration-tests/java/buildless-inherit-trust-store/settings.xml | New Maven settings defining GCS mirror for central. |
Copilot's findings
- Files reviewed: 93/93 changed files
- Comments generated: 4
oscarsj
approved these changes
Jun 24, 2026
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.
This pull request updates several Java integration tests to use the Google Cloud Storage (GCS) mirror for Maven Central instead of the default Maven Central repository.
The main goal is to improve download speeds and reliability in the test environments by redirecting dependency and plugin fetches to the GCS mirror.
Non-buildless tests
The changes include adding/updating the Maven
settings.xmlfiles, modifying expected fetch outputs, and ensuring the test code uses the new settings. Wherever possible, I added or updatedsettings.xmlfiles to test directories to define a<mirror>for Maven Central pointing to the GCS mirror (https://maven-central.storage-download.googleapis.com/maven2/). This ensures Maven uses the mirror for all requests to the central repository.Buildless tests
In some test cases, where the
settings.xmlfile was under test, I updated thepom.xmlfiles to redefine the GCS mirror as thecentralrepository. This allows me to mimic the behavior of a proper mirror without modifyingsettings.xml. Unfortunately, this doesn't seem as reliable as defining a proper<mirror>insettings.xml, because I was still able to observe some DNS name resolutions of repo.maven.apache.org, but it's better than doing nothing.