블로그 이미지
Peter Note
Web & LLM FullStacker, Application Architecter, KnowHow Dispenser and Bike Rider

Publication

Category

Recent Post

'Maven2'에 해당되는 글 1

  1. 2012.11.23 [Linux] Ubuntu 에 Maven 2 설치
2012. 11. 23. 10:00 Middleware, Cloud/Linux

jboss source build를 위하여 ubuntu에 maven을 설치해 보자 


1) maven2 설치 하기

2) maven 설치 와 실행 파일 위치

root@ip-10-146-81-140:/etc/maven2# cd /usr/share/maven2   <-- 설치 위치
root@ip-10-146-81-140:/usr/share/maven2# ls
bin  boot  conf  lib
root@ip-10-146-81-140:/usr/share/maven2# cd /etc/maven2    <-- 환경 파일 저장 위치
root@ip-10-146-81-140:/etc/maven2# ls
m2.conf  settings.xml
root@ip-10-146-81-140:/etc/maven2# ls -alrt /etc/bin/mvn     <-- 실행 파일 symbolic link
ls: cannot access /etc/bin/mvn: No such file or directory
root@ip-10-146-81-140:/etc/maven2# ls -alrt /usr/bin/mvn
-rwxr-xr-x 1 root root 6331 Oct 24  2011 /usr/bin/mvn
root@ip-10-146-81-140:/etc/maven2# cd bin
bash: cd: bin: No such file or directory
root@ip-10-146-81-140:/etc/maven2# cd /usr/share/maven2/bin
root@ip-10-146-81-140:/usr/share/maven2/bin# ls -alrt
total 8
lrwxrwxrwx 1 root root   21 Oct 24  2011 mvnDebug -> ../../../bin/mvnDebug
lrwxrwxrwx 1 root root   16 Oct 24  2011 mvn -> ../../../bin/mvn
lrwxrwxrwx 1 root root   15 Oct 24  2011 m2.conf -> ../conf/m2.conf
drwxr-xr-x 5 root root 4096 Nov 23 00:26 ..
drwxr-xr-x 2 root root 4096 Nov 23 00:26 .
root@ip-10-146-81-140:/usr/share/maven2/bin#


설치하면 현재(2012.11)기준 Maven version 2.2.1 이다. 그러나 최신 버전은 3.0.4 이다 


  - 아파치 메이븐 사이트


Ubuntu에 최신버전을 설치하려면 apt-get으론 안되고 별도의 과정을 거친다.

  - wget http://apache.mirror.cdnetworks.com/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.zip

  - 압축을 풀고 환경변수 : export M2_HOME=<install dir path> 그리고 export M2=$M2_HOME/bin

  - PATH 환경변수 : export PATH=$M2:$PATH

  - 버전확인 : mvn -version 

dev@ip-10-146-81-140:~/deploy$ wget http://apache.mirror.cdnetworks.com/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.zip

--2012-11-23 00:55:59--  http://apache.mirror.cdnetworks.com/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.zip

Resolving apache.mirror.cdnetworks.com (apache.mirror.cdnetworks.com)... 61.110.198.174

Connecting to apache.mirror.cdnetworks.com (apache.mirror.cdnetworks.com)|61.110.198.174|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 4889768 (4.7M) [application/zip]

Saving to: `apache-maven-3.0.4-bin.zip'


100%[============================================================================>] 4,889,768   1.46M/s   in 3.2s


2012-11-23 00:56:02 (1.46 MB/s) - `apache-maven-3.0.4-bin.zip' saved [4889768/4889768]


dev@ip-10-146-81-140:~/deploy$ ll

total 4784

drwxrwxr-x 2 dev dev    4096 Nov 23 00:55 ./

drwxr-xr-x 7 dev dev    4096 Nov 23 00:53 ../

-rw-rw-r-- 1 dev dev 4889768 Sep  5 07:01 apache-maven-3.0.4-bin.zip

dev@ip-10-146-81-140:~/deploy$ unzip apache-maven-3.0.4-bin.zip

Archive:  apache-maven-3.0.4-bin.zip

   creating: apache-maven-3.0.4/

   creating: apache-maven-3.0.4/boot/

  inflating: apache-maven-3.0.4/boot/plexus-classworlds-2.4.jar

   -- 중략 --

   creating: apache-maven-3.0.4/lib/ext/

  inflating: apache-maven-3.0.4/lib/ext/README.txt

dev@ip-10-146-81-140:~/deploy$vi .bashrc 


<.bashrc 삽입 내역> 

export M2_HOME=/home/dev/deploy/apache-maven-3.0.4

export M2=$M2_HOME/bin

export PATH=$M2:$PATH



dev@ip-10-146-81-140:~$ . .bashrc

dev@ip-10-146-81-140:~$ mvn -version

Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000)

Maven home: /home/dev/deploy/apache-maven-3.0.4

Java version: 1.7.0_09, vendor: Oracle Corporation

Java home: /usr/lib/jvm/java-7-oracle/jre

Default locale: en_US, platform encoding: UTF-8

OS name: "linux", version: "3.2.0-31-virtual", arch: "amd64", family: "unix"


posted by Peter Note
prev 1 next