Skip to content

Use Maven Central mirror in Java Maven integration tests#22046

Open
mario-campos wants to merge 1 commit into
mainfrom
mario-campos/mirror-maven-central/maven
Open

Use Maven Central mirror in Java Maven integration tests#22046
mario-campos wants to merge 1 commit into
mainfrom
mario-campos/mirror-maven-central/maven

Conversation

@mario-campos

Copy link
Copy Markdown
Contributor

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.xml files, modifying expected fetch outputs, and ensuring the test code uses the new settings. Wherever possible, I added or updated settings.xml files 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.xml file was under test, I updated the pom.xml files to redefine the GCS mirror as the central repository. This allows me to mimic the behavior of a proper mirror without modifying settings.xml. Unfortunately, this doesn't seem as reliable as defining a proper <mirror> in settings.xml, because I was still able to observe some DNS name resolutions of repo.maven.apache.org, but it's better than doing nothing.

Copilot AI review requested due to automatic review settings June 24, 2026 18:00
@mario-campos mario-campos requested a review from a team as a code owner June 24, 2026 18:00
@github-actions github-actions Bot added the Java label Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.xml files that define a Maven Central mirror pointing at https://maven-central.storage-download.googleapis.com/maven2/.
  • Update many integration-test test.py harnesses to pass LGTM_INDEX_MAVEN_SETTINGS_FILE so Maven uses the new settings.
  • For some buildless tests where settings.xml is itself under test, modify pom.xml repository 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

@mario-campos mario-campos requested a review from a team June 24, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants