gaogaotiantian commented on code in PR #55238:
URL: https://github.com/apache/spark/pull/55238#discussion_r3046966899


##########
build/sbt-launch-lib.bash:
##########
@@ -182,6 +183,18 @@ run() {
   set -- "${residual_args[@]}"
   argumentCount=$#
 
+  # If MAVEN_MIRROR_URL is set, generate a repositories config so the SBT 
launcher
+  # resolves SBT and Scala through the mirror during the boot phase.
+  if [[ -n "$MAVEN_MIRROR_URL" ]]; then
+    local sbt_repo_config="$(mktemp /tmp/sbt-repositories.XXXXXX)"
+    cat > "$sbt_repo_config" <<EOF
+[repositories]
+  local
+  maven-mirror: ${MAVEN_MIRROR_URL}
+EOF
+    addJava "-Dsbt.repository.config=$sbt_repo_config"

Review Comment:
   If `-Dsbt.repository.config` is already set by the users, what would happen? 
We still want that to work right? Also maybe we should cleanup the temp dir 
after the script? Even if it's in `/tmp`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to