Beginner Friendly Maven Explanation.

Hasan Ozyer
4 min readJun 30, 2023

--

Alright, Maven seems to play a core role in terms of a project structure so i am here to explain therefore understand what the hell is going on.

In a Nutshell

What is it?

“Maven, a Yiddish word meaning accumulator of knowledge, began as an attempt to simplify the build processes in the Jakarta Turbine project.” according to their offical website.

A Project Without Maven?!?!?!

📌First it would be better to understand what did maven solved, so that i could understand what led Maven to become the most popular choice while creating projects in Java and C#.

📌Let’s assume you want to create a Java project Hasan. To complete this project you need a third party libraries. Without further chit-chatting, i will show you step by step how we implement a Selenium JAR file without using Maven. So you can see it yourself.

1-) Create a Normal JAVA Project.

2-) If you write down a Scanner object and initialize it, it will turn red. Because you didn’t imported it yet.

3-) Now when you import it the redness will be gone. BTW, this one was built-in package within the Java. You just imported it.

4-) Now, imagine Selenium. Because it is a third party, it is not a pre-built feature like java.util.* library, so first you have to find the official website and download the JAR file to our External Libraries.

5-) You download it.

6-) Now go to your IntelliJ and press Ctrl+Alt+Shift+S to open your Project Structure. From there, click on Libraries tab.

7-) Click on Plus icon and select Java.

8-) Now, find your newly downloaded Selenium Jar folder and import them.

9-) Sound like fun! now you downloaded the JAR file, you can access to import it to your Brand new Java project!!!

🔑 Now, snap back to reality, not only two or three, there are so many types of libraries which we need to complete a project. To do this, we need to go to each and every website, and from there, we need to download the JAR files, then we need to attach them to your project. These are Manuel processes without Maven.

🔑 Apart from this, let’s suppose you added the third party libraries and attached them to the project, let’s say you want to update your project to the latest version, so you have to get all of the latest versions of third party libraries. What you’ll do is, let me tell you what you’ll do, you have to remove all of the existing libraries from you project, then you have to do the first part again, then add them to your project. This is also continues process.

🔑 In conclusion, There are the two major problems we face if we dont use Maven. First thing is we have to download all the third party libraries from different websites and add them to our project manually. The second thing is upgrades. If you want to upgrade all the third party libraries into latest versions, you need to remove all th existing ones and add the latest ones.

A Project With Maven?!?!?!

📌Maven is basically a build tool. Whenever you create a Maven Project, you will always get a pom.xml file that is created automatically for you.

📌Maven will give you project structure. By default, whatever the fold structure we will need in the project, it will be provided by the maven.

📌 It will provide you with a pom.xml file, which we will add dependincies and plugins. When you have dependincies in the pom.xml, it will automatically download all the third party libraries into your project. That is the main advantage of dependincies. Plugins are basically all the configuration things realted to the project like compilig the project and runnig the project etc.

📌 You can generate some documentation that is related to your project.

📌 You can package the project which is another powerful tool that maven provides. Packaging means, once you have done with your project, you do not provide all the hard-code project to your client. That would be not very pleasant. So you need to package it and submit it to your client .

--

--

Hasan Ozyer

Junior Test Automation Engineer. Documenting my IT journey for my future self. Sharing my opinions, learnings, and adventures in the tech world.