Total Pageviews

Friday, 13 April 2012

Install Maven 3.0.3

Maven 3.0.3 is compatible for Maven 2 project.
It’s quite easy to install it on Windows and Ubuntu. Take Ubuntu for example, just run following commands :
Install Maven 3.0.3 in Ubuntu 10.10

1
2
3
4
$ wget http://ftp.heanet.ie/mirrors/www.apache.org/dist/maven/binaries/apache-maven-3.0.3-bin.tar.gz
$ tar -zvxf apache-maven-3.0.3-bin.tar.gz
$ sudo cp -R apache-maven-3.0.3 /usr/local
$ sudo ln -s /usr/local/apache-maven-3.0.3/bin/mvn /usr/bin/mvn
However, if you still have to use Maven 2 and 3 together, in Windows , you can create following bat files:
Mave2.bat

1
2
3
4
5
6
@ECHO off
set M2_HOME=C:\Program Files\Apache\apache-maven-2.2.1
set org_path=%PATH%
path %PATH%;%M2_HOME%\bin
call mvn %*
path %org_path%
Mave3.bat

1
2
3
4
5
6
@ECHO off
set M2_HOME=C:\Program Files\Apache\apache-maven-3.0.3
set org_path=%PATH%
path %PATH%;%M2_HOME%\bin
call mvn %*
path %org_path%

---------------------------------
apt-get install maven2

No comments:

Post a Comment