Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support proxying #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ get_maven() {
local destdir=$2

local major=$(echo $version | cut -d '.' -f 1)
local base="https://archive.apache.org/dist/maven"
local base="${ASDF_MAVEN_MIRROR:=https://archive.apache.org/dist/maven}"
local url="$base/maven-$major/$version/binaries/apache-maven-$version-bin.tar.gz"
Comment on lines +23 to 24

Choose a reason for hiding this comment

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

Using closer.lua would help direct traffic to CDN for releases available there (example). For older releases, it redirects to archive (example).

Suggested change
local base="${ASDF_MAVEN_MIRROR:=https://archive.apache.org/dist/maven}"
local url="$base/maven-$major/$version/binaries/apache-maven-$version-bin.tar.gz"
local path="maven-$major/$version/binaries/apache-maven-$version-bin.tar.gz"
local url="https://www.apache.org/dyn/closer.lua/maven/$path?action=download"
if [[ -n "${ASDF_MAVEN_MIRROR:-}" ]]; then
url="${ASDF_MAVEN_MIRROR}/$path"
fi


if [[ "$version" == *SNAPSHOT ]]; then
Expand Down