Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions bin/exec-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# if asdf provides java, then let's use that rather the system one (if at all avail)
if asdf current java > /dev/null 2>&1
then
export JAVA_HOME=$(asdf where java)
fi
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
Copy link
Copy Markdown

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