Install Maven3 on Ubuntu 12.04


previously install Java.

jmprieto@dev-server:~$ cd
jmprieto@dev-server:~$ ll
total 28
drwxr-xr-x 3 jmprieto jmprieto 4096 may  3 19:33 ./
drwxr-xr-x 3 root     root     4096 may  3 19:25 ../
-rw------- 1 jmprieto jmprieto  286 may  3 19:46 .bash_history
-rw-r--r-- 1 jmprieto jmprieto  220 may  3 19:25 .bash_logout
-rw-r--r-- 1 jmprieto jmprieto 3486 may  3 19:25 .bashrc
drwx------ 2 jmprieto jmprieto 4096 may  3 19:26 .cache/
-rw-r--r-- 1 jmprieto jmprieto  675 may  3 19:25 .profile
jmprieto@dev-server:~$ pwd
/home/jmprieto
jmprieto@dev-server:~$ wget http://apache.rediris.es/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz
--2014-05-03 20:05:38--  http://apache.rediris.es/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz
Resolviendo apache.rediris.es (apache.rediris.es)... 130.206.1.5
Conectando con apache.rediris.es (apache.rediris.es)[130.206.1.5]:80... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 6927918 (6,6M) [application/x-gzip]
Grabando a: “apache-maven-3.2.1-bin.tar.gz”

100%[======================================================================================================================================================================>] 6.927.918   1,74M/s   en 3,6s    

2014-05-03 20:05:42 (1,83 MB/s) - “apache-maven-3.2.1-bin.tar.gz” guardado [6927918/6927918]

jmprieto@dev-server:~$ tar -zxf apache-maven-3.2.1-bin.tar.gz 
jmprieto@dev-server:~$ ll
total 6800
drwxr-xr-x 4 jmprieto jmprieto    4096 may  3 20:06 ./
drwxr-xr-x 3 root     root        4096 may  3 19:25 ../
drwxrwxr-x 6 jmprieto jmprieto    4096 may  3 20:06 apache-maven-3.2.1/
-rw-rw-r-- 1 jmprieto jmprieto 6927918 feb 22 09:27 apache-maven-3.2.1-bin.tar.gz
-rw------- 1 jmprieto jmprieto     286 may  3 19:46 .bash_history
-rw-r--r-- 1 jmprieto jmprieto     220 may  3 19:25 .bash_logout
-rw-r--r-- 1 jmprieto jmprieto    3486 may  3 19:25 .bashrc
drwx------ 2 jmprieto jmprieto    4096 may  3 19:26 .cache/
-rw-r--r-- 1 jmprieto jmprieto     675 may  3 19:25 .profile
jmprieto@dev-server:~$ sudo cp -R apache-maven-3.2.1 /usr/local
jmprieto@dev-server:~$ ll /usr/local/apache-maven-3.2.1/
total 48
drwxr-xr-x  6 root root  4096 may  3 20:06 ./
drwxr-xr-x 11 root root  4096 may  3 20:06 ../
drwxr-xr-x  2 root root  4096 may  3 20:06 bin/
drwxr-xr-x  2 root root  4096 may  3 20:06 boot/
drwxr-xr-x  3 root root  4096 may  3 20:06 conf/
drwxr-xr-x  3 root root  4096 may  3 20:06 lib/
-rw-r--r--  1 root root 14865 may  3 20:06 LICENSE
-rw-r--r--  1 root root   182 may  3 20:06 NOTICE
-rw-r--r--  1 root root  2513 may  3 20:06 README.txt
jmprieto@dev-server:~$ vi ~/.profile
jmprieto@dev-server:~$ exit
export JAVA_HOME="/usr/lib/jvm/java-6-openjdk"
export M2_HOME="/usr/local/apache-maven-3.2.1"
export M2="$M2_HOME/bin"
export PATH="$M2:$PATH"
jmprieto@dev-server:~$ java -version
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.4)
OpenJDK Server VM (build 20.0-b12, mixed mode)
jmprieto@dev-server:~$ mvn -v
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Maven home: /usr/local/apache-maven-3.2.1
Java version: 1.6.0_27, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-i386/jre
Default locale: es_ES, platform encoding: UTF-8
OS name: "linux", version: "3.11.0-15-generic", arch: "i386", family: "unix"
Anuncios
Install Maven3 on Ubuntu 12.04