Find your content:

Search form

You are here

Learn Maven (MVN)

 
Share

Maven is a build tool. It helps to build the Java project and share the jar files across the projects.

How to setup Maven (MVN)?

Step1: Download the Maven from https://maven.apache.org/download.cgi (Note: Maven 3.3+ require JDK 1.7 or above to execute - they still allow you to build against 1.3 and other JDK versions by using toolchains)

Step2: Extract the zip file

Step3: Run the below command

sudo vi ~/.bash_profile

Step4: Add the maven executable in path ( provide your oath where you unzipped the maven)

export PATH = $PATH:/opt/apache-maven/bin

Step5: Save the file and run the below command to activate the new changes in bash_profile.

source ~./bash_profile

Step6: Check the mvn version in "mvn --version", it should return below data( folder path vary based on your installation)

Maven home: /opt/apache-maven
Java version: 11.0.7, vendor: AdoptOpenJDK
Java home: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.4", arch: "x86_64", family: "mac"

 

Note: Sometimes mvn --version may not work when close the terminal and open. If that happens follow this link http://helpinterview.com/?q=content/do-i-need-run-source-bashprofile-everytime to resolve the issue in Mac.

My Block Status

My Block Content