aboutsummaryrefslogtreecommitdiff
path: root/src/java/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/install.sh')
-rw-r--r--src/java/install.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/java/install.sh b/src/java/install.sh
index 64646fa..411fffb 100644
--- a/src/java/install.sh
+++ b/src/java/install.sh
@@ -10,6 +10,8 @@
# Syntax: ./java-debian.sh [JDK version] [SDKMAN_DIR] [non-root user] [Add to rc files flag]
JAVA_VERSION=${VERSION:-"lts"}
+INSTALL_GRADLE=${INSTALL_GRADLE:-"false"}
+INSTALL_MAVEN=${INSTALL_MAVEN:-"false"}
export SDKMAN_DIR=${SDKMAN_DIR:-"/usr/local/sdkman"}
USERNAME=${USERNAME:-"automatic"}
@@ -167,4 +169,16 @@ if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then
su ${USERNAME} -c ". ${SDKMAN_DIR}/bin/sdkman-init.sh && sdk default java ${JAVA_VERSION}"
fi
+# Install Gradle
+if [[ "${INSTALL_GRADLE}" = "true" ]] && ! gradle --version > /dev/null; then
+ sdk_install gradle latest
+ updaterc '[ -z "${GRADLE_USER_HOME}" ] && export GRADLE_USER_HOME=${HOME}/.gradle'
+fi
+
+# Install Maven
+if [[ "${INSTALL_MAVEN}" = "true" ]] && ! mvn --version > /dev/null; then
+ sdk_install maven latest
+ updaterc '[ -z "$M2" ] && export M2=$HOME/.m2'
+fi
+
echo "Done!"