Header Ads Widget

What is Maven | Maven Tutorial for beginner | How does Maven work?

what-is-maven-maven-tutorial-for-beginner-how-does-maven-work


            1 – What is Maven? 

2 – Why do we need Maven

 

3 – What happens if Maven is not used

 

4 – Uses of Maven

 

5 – Companies using Maven

 

 

1 – What is Maven?

 

The  maven without any doubt is one of the most popular build tools in java.

 

so what exactly is maven maven is a build automation tool used primarily for java projects.

 

now along with java projects there are many more languages, such as

 

C sharp

 

Ruby and even

 

Scala

 

which uses maven as their manage project tools or build tools.

 

 

now there is something called as pom or,

 

project object model in maven which builds a project using pom and,

 

this is basically a set of plugins.

 

so it's important that you remember these phrases,

 

Build Automation Tool and,

 

Project Object Model (POM).

 

You need to understand that maven project is hosted by apache software foundation,

 

which was formerly known as jakarta project.

 

with that let's quickly look at what exactly is build automation tool.

 

now speaking in general build automation tool or build automation also,

 

it's basically a process of automating creation of software built and,

 

the associated process including compiling computer source code into binary code and things like these.

 

so here they use automated whole process from our source code to machine code.

 

also the software build creation packaging binary code and running the automated tests.

 

I hope this is clear now the next thing That,

 

I told that we have to remember is project object model or pom,

 

so what exactly is pom.

 

now here pom in maven is basically a fundamental work unit,

 

so everything runs in and around project object model.

 

it's basically an xml file that contains information about project and configuration details used by maven to build any particular project.

 

 

2 – Why do we need Maven

 

Now there are many uses of maven of course we'll look into it ahead.

 

now these are some of the constraints which we need to know about maven.

 

so basically using maven makes the build process easier.

 

so build of the project is also made easier and the automation process is also made easier.

 

also it provides uniform build system.

 

so basically once you familiarize yourself with one main project,

 

you know how all the maven projects build.

 

this saves time when navigating many projects.

 

now providing quality project information.

 

basically maven provides useful project information that is in part taken from your pom itself.

 

 

maven is used for encouraging better development practices.

 

usage of build tools is always a good thing when you're creating huge projects for huge organizations.

 

 with that there are some more advantages of using maven with respect to project object model.

 

 

basically maven provides useful project information that is a part taken from your pom and part generated from project sources itself.

 

so what exactly is a need to use maven with respect to pom.

 

now we can easily build a project using maven.

 

that's already established by now,

 

we can add jars and other dependencies of the project to make the project look easier using maven.

 

maven also provides information such as log document dependency list unit test reports etc.

 

and it is very useful for a project while updating central repository of jars and other dependencies.

 

also with the help of maven we can build any number of projects into output types like jar war basically without doing any scripting at all.

 

now that's all about the needs of maven so what exactly happens.

 

 

 

3 – What happens if Maven is not used?

 

what happens if we don't use maven to understand the benefits of using maven.

 

so let's quickly go ahead and look at what happens if maven has not been used.

 

now building project gets harder of course by now by all the features and all the use cases that we have looked at we understand this.

 

now getting project information also gets harder,

 

like you want to know the source code and everything also updating project gets harder without central repository.

 

central repository always helps you have all the applications and it gets harder,

 

if maven is not being used,

 

also adding new dependency is difficult due to absence of project object model.

 

pretty obvious when you don't use maven there's no pom as well.

 

also creating multiple projects is almost impossible,

 

now of course it might take time but it might take days or even years some cases.

 

 

project creation in multiple environment is also impossible.

 

So that being understood we should be switching to maven,

 

 

4 – Uses of Maven

 

Maven helps us

 

Easily build projects with unnecessary details almost hidden.

 

so that goes into the backdrop and,

 

Dependency management including automatic updation

 

of course because it is a build automation tool is present only because of maven and

 

there's ample

 

Ability to handle multiple projects simultaneously

 

because of the presence of maven

 

Dynamic downloading of necessary java libraries plugins from maven repository is possible

 

now of course when you have build tools such as maven,

 

that comes with many number of inbuilt tools,

 

so these can be used only if you use maven.

 

Also maven can add all dependencies required for project automatically by reading a pom file.

 

This is where our project object model or pm files comes into big picture.

 

Also there are some more concepts such as

 

Build plugins

 

Build profiles pom

 

Files dependencies and

 

Repositories bill life cycle faces and goals,

 

which comes into picture while using maven and you can use all of these.

 

5 – Companies using Maven

 

The companies which are using maven.

 

There are many number of companies and here are some of the top-notch companies that use maven rigorously.

 

Now if you look up there are many more companies that will be using mevu,

 

of course by now we have already established that maven is an important tool,

 

and most importantly it reduces a lot of work as a developer for you.

Post a Comment

0 Comments