1) Being as a first point you have to download maven
Download from this link
http://maven.apache.org/download.cgi
2) Create folders on your mac
Click Go->Go to folder /usr/local
right click create new folder “apache-maven”
open this folder and again create sub folder
folder name “apache-maven-3.2.2” Hint- based up on your maven version you can put folder name
3)Then open Terminal command prompt .
localhost:~ userid$ cd /usr/local
localhost:local userid$ ls
apache-maven git libexec
localhost:local userid$ cd apache-maven
localhost:apache-maven userid$ ls
apache-maven-3.2.2
localhost:apache-maven userid$ cd apache-maven-3.2.2
localhost:apache-maven-3.2.2 userid$ export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.2
localhost:apache-maven-3.2.2 userid$ M2=$M2_HOME/bin
localhost:apache-maven-3.2.2 userid$ export PATH=$M2:$PATH
localhost:apache-maven-3.2.2 userid$ echo $JAVA_HOME
/Library/Java/Home
localhost:apache-maven-3.2.2 userid$ mvn --version
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T14:51:42+01:00)
Maven home: /usr/local/apache-maven/apache-maven-3.2.2
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"
localhost:apache-maven-3.2.2 userid$ whereis mvn
To find path where is maven use this command
localhost:apache-maven-3.2.2 userid$mvn -version
Now your maven setup done.
More detailed Help details :
http://maven.apache.org/download.cgi
As per above link you can get details as below.
details available on bottom of the page.
Extract the distribution archive, i.e. apache-maven-3.2.2-bin.tar.gz to the directory you wish to install Maven 3.2.2.
These instructions assume you chose /usr/local/apache-maven. The subdirectory apache-maven-3.2.2 will
be created from the archive.
In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.2.
Add the M2 environment variable, e.g. export M2=$M2_HOME/bin.
Optional: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS="-Xms256m -Xmx512m".
This environment variable can be used to supply extra options to Maven.
Add M2 environment variable to your path, e.g. export PATH=$M2:$PATH.
Make sure that JAVA_HOME is set to the location of your JDK, e.g.
export JAVA_HOME=/usr/java/jdk1.7.0_51 and that $JAVA_HOME/bin is in your PATH environment variable.
Run mvn --version to verify that it is correctly installed.
No comments:
Post a Comment