From 2b18c1a58839d82b5d20a44cffcf2130fdbad6ac Mon Sep 17 00:00:00 2001 From: Samruddhi Khandale Date: Fri, 22 Jul 2022 20:20:24 +0000 Subject: bundle maven and gradle --- src/java/install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/java/install.sh') 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!" -- cgit v1.2.3