Skip to content

[SPARK-56338][INFRA] Support Maven mirrors for build#55168

Closed
gaogaotiantian wants to merge 1 commit intoapache:masterfrom
gaogaotiantian:support-maven-mirror
Closed

[SPARK-56338][INFRA] Support Maven mirrors for build#55168
gaogaotiantian wants to merge 1 commit intoapache:masterfrom
gaogaotiantian:support-maven-mirror

Conversation

@gaogaotiantian
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Support Maven mirrors when building Spark. Users can define an environment variable MAVEN_MIRROR_URL to use a mirror site for Maven packages.

Why are the changes needed?

It provides flexibility for users to direct the build system to a mirror/proxy site when the default ones are not available for networking reasons (unstable connection, access restriction etc).

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Locally tested with a mirror site.

Was this patch authored or co-authored using generative AI tooling?

No.

@zhengruifeng
Copy link
Copy Markdown
Contributor

merged to master

cloud-fan added a commit that referenced this pull request Apr 9, 2026
…er bootstrap

### What changes were proposed in this pull request?

This is a follow-up to #55168. The SBT launcher script (`build/sbt-launch-lib.bash`) did not respect `MAVEN_MIRROR_URL`. This patch adds support for it in two places:

1. **Launcher JAR download**: `MAVEN_MIRROR_URL` is used as the default for `DEFAULT_ARTIFACT_REPOSITORY` when neither is explicitly set.
2. **SBT boot phase**: When `MAVEN_MIRROR_URL` is set, a temporary SBT repositories config is generated and passed via `-Dsbt.repository.config` so SBT resolves itself and Scala through the mirror.

### Why are the changes needed?

SPARK-56338 added `MAVEN_MIRROR_URL` support for Maven (`pom.xml`) and SBT project builds (`SparkBuild.scala`), but the SBT launcher script was not covered. In environments where default Maven repositories are unreachable, the SBT launcher JAR download and boot phase still fail without manual configuration (e.g. `~/.sbt/repositories`).

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Manually tested by setting `MAVEN_MIRROR_URL` and building Spark with SBT from scratch (launcher JAR removed, no `~/.sbt/repositories`).

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code

Closes #55238 from cloud-fan/spark-56338-sbt-mirror.

Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@gaogaotiantian gaogaotiantian deleted the support-maven-mirror branch April 9, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants