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
- 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.
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
- 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
- Step 3: Unzip downloaded folder
- Step 4: Save Unzipped folder at specific location
Setup Maven Environment Variables
- Step 5: Go to computer start and search “Environment Variables”
- Step 6: Open Environment variables and new window will open with “Environment Variable”.
- Step 7: Click on “New” to 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:
- Step 9: Click on “OK” and click on “Path” variable . New window “Edit environment Variable” open.
- Step 10: Add “%MVN_HOME%\bin” in “Path”variable as per below snapshot:
- 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.
Hope above steps help you in Maven set up. Pease feel free to contact us on firstname.lastname@example.org if you face any issue or need more information.