Created
July 10, 2022 19:27
-
-
Save lioneltchami/085b505a133ae205b4c85d5b6cf38fbd to your computer and use it in GitHub Desktop.
MAVEN SCRIPT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mvn_version=${mvn_version:-3.8.6} | |
| url="http://www.mirrorservice.org/sites/ftp.apache.org/maven/maven-3/${mvn_version}/binaries/apache-maven-${mvn_version}-bin.tar.gz" | |
| install_dir="/opt/maven" | |
| mkdir ${install_dir} | |
| curl -fsSL ${url} | tar zx --strip-components=1 -C ${install_dir} | |
| cat << EOF > /etc/profile.d/maven.sh | |
| #!/bin/sh | |
| export MAVEN_HOME=${install_dir} | |
| export M2_HOME=${install_dir} | |
| export M2=${install_dir}/bin | |
| export PATH=${install_dir}/bin:$PATH | |
| EOF | |
| source /etc/profile.d/maven.sh | |
| echo maven installed to ${install_dir} | |
| mvn --version | |
| # PLEASE NOTE : you need to add THE COMMAND : source /etc/profile.d/maven.sh to ~/.bash_profile or basrch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment