Linux에 Maven 설치하기

Programming/Java 2018.07.21 22:06 Posted by 파란크리스마스

출처

Maven 다운로드

$ wget http://mirror.navercorp.com/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz

Maven 압축 해제

$ tar xvf apache-maven-3.5.4-bin.tar.gz

Maven /opt 디렉토리 밑으로 이동

$ sudo mv apache-maven-3.5.4 /opt

Maven /opt/maven 링크 설정

$ sudo ln -s /opt/apache-maven-3.5.4 /opt/maven

Maven 환경설정

$ echo "export M2_HOME=/opt/maven" | sudo tee -a /etc/profile
$ source /etc/profile
$ echo "export PATH=$PATH:$M2_HOME/bin" | sudo tee -a /etc/profile
$ source /etc/profile

Maven 설치확인

$ mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: /opt/maven
Java version: 1.8.0_171, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-armhf/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.4.39-bpi-m2p-kernel", arch: "arm", family: "unix"