Step by Step Tutorial for Maven Installation

Why we need Maven in our project?

During coding journey, we come across one of the most common challenge to manage project information, maintain best practices in coding, machine-independent code and migration of project. Let’s take one example where you work in a team and each developer working on different module and adding dependent jar as per their need also everyone adding a different version of dependency here maintain project artefacts is quite challenging and while merging cod, sharing or deploying on the server is terrible due to different version of jars. But one of the great tool developed by Json in 2002 which solves these problems that tool is “Maven”.

What is Maven & What’s the purpose of Maven?

Maven, a [Yiddish word] meaning of it “accumulator of knowledge”. Maven is used to manage java based Projects. Here is the objective of Maven:

  • Making Build Process simpler
  • Provide uniform Build System
  • Quality Project Information
  • Easy Deployment
  • Manage repository

Pre-Requisites:

  • Step 1: Java should be installed in machine.

How to check java version from cmd?

Steps to check Java Installation/Version: Open command prompt and type “java -version” and enter.

java-version

If java is not installed on your machine then click here for step by step tutorial of Java installation
Or, Click on below Link: https://thoughtcoders.com/blog/install-java-and-setup-environment-variable/

Maven Installation :

Steps to Install Maven:

  • Step 1: Go to below link

http://maven.apache.org/download.cgi

  • Step 2: Scroll to File section and download binaries file as per machine. Click on highlighted link to set up on windows machine.

Or directly click on this link: https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip

Maven installation link
  • Step 3: Unzip downloaded folder
Extract maven zipped file
  • Step 4: Save Unzipped folder at specific location
Maven Unzipped

Setup Maven Environment Variables

  • Step 5: Go to computer start and search “Environment Variables”
Environment variables
  • Step 6: Open Environment variables and new window will open with “Environment Variable”.
System properties
Environment variables dialog
  • Step 7: Click on “New” to create System Variable:
Create system variable
  • Step 8: Create System variable with name “MAVEN_HOME” and enter maven binaries folder path till bin folder in variable value field. Refer below snapshot:
MAVEN_HOME Environment Variable
  • Step 9: Click on “OK” and click on “Path” variable . New window “Edit environment Variable” open.
New Environment path
Environment Path
  • Step 10: Add “%MVN_HOME%\bin” in “Path”variable as per below snapshot:
Maven path variable
  • Step 11: Click on Ok and Apply and save all windows.
  • Step 12: To verify Maven installation- Open command prompt and type “mvn-version” and enter. It will give Maven version.
maven -version

Hope above steps help you in Maven set up. Pease feel free to contact us on query@thoughtcoders.com if you face any issue or need more information.

Reference :
http://maven.apache.org/download.cgi

close

Subscribe to our Newsletter:

Open chat
Feel free to contact