Skip to content

Instantly share code, notes, and snippets.

@DanEdens
Created December 23, 2022 17:02
Show Gist options
  • Save DanEdens/8d16ab7fd62304390caf5ff67c061077 to your computer and use it in GitHub Desktop.
Save DanEdens/8d16ab7fd62304390caf5ff67c061077 to your computer and use it in GitHub Desktop.
Install-apache-maven-windows
@echo off
echo Installing Apache Maven...
rem Set the Maven version to install
set MAVEN_VERSION=3.6.3
rem Set the installation directory for Maven
set MAVEN_INSTALL_DIR=C:\Program Files\Apache\maven
rem Download the Maven binary from the Apache website
curl -o apache-maven-%MAVEN_VERSION%-bin.zip http://mirror.nbtelecom.com.br/apache/maven/maven-3/%MAVEN_VERSION%/binaries/apache-maven-%MAVEN_VERSION%-bin.zip
rem Extract the Maven binary to the installation directory
7z x apache-maven-%MAVEN_VERSION%-bin.zip -o%MAVEN_INSTALL_DIR%
rem Add the Maven bin directory to the PATH environment variable
setx PATH "%PATH%;%MAVEN_INSTALL_DIR%\bin"
echo Apache Maven %MAVEN_VERSION% has been installed to %MAVEN_INSTALL_DIR%
echo The Maven bin directory has been added to the PATH environment variable
echo.
echo Installation complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment