DEV Community

Cover image for What is Maven?
priyanshu pardhi
priyanshu pardhi

Posted on

What is Maven?

Maven is project management tool.

In java, whenever you want to make a project you need lots of third party libraries such as MySql connector.

If you are not using maven in your project you need to download lots of external jar files and manually configure those into your project also updating that is a tiresome process that’s why we need maven which make developer’s life easier

A maven project basically consist of :-

  • POM file

In which we have :-

  • Group ID (let say “com.app”), define your package
  • Artifact ID (let say “demo”), represent your project name
  • Package (com.app.demo.web)

How do you mention in the pom.xml file that I want this dependency in my project? for that you need to add XML code for that dependency

To get the xml code for a particular module:

  • just go to MVN Repository
  • Search for desired module
  • Select the available version, check xml code for that module/ dependency

When you are working with maven you need to have internet connection

If you are using any dependency for the first time.

First, it will check for that dependencies in Local Repo, if not found, it will check download/fetch from Remote Repo

Alternate of Maven is Gradle

Thanks for reading

Top comments (9)

Collapse
 
adriens profile image
adriens

A convenient way to install mvn is to use SDKMAN! : then you just have to run the following script :

sdk install maven
Enter fullscreen mode Exit fullscreen mode
Collapse
 
priyanshupardhi profile image
priyanshu pardhi

Thanks for sharing ☺

Collapse
 
adriens profile image
adriens

UR Weclome : good tools make great programmers... and I'm a mvn fanboy since almost 14 years now <3. It's an amazing and real open source tool. <3

Collapse
 
lico profile image
SeongKuk Han

Ah~ that's like a npm, right? A package manager. Is that available in not java?

Collapse
 
khmarbaise profile image
Karl Heinz Marbaise

npm is more or less a package manager only ... Maven is much more ... dependency management, build tool, packaging tool, site generation etc...

Collapse
 
priyanshupardhi profile image
priyanshu pardhi

Yes, kind of but it's not that huge.

Collapse
 
khmarbaise profile image
Karl Heinz Marbaise

better use search.maven.org/ becase this is a search for central repository.

Collapse
 
priyanshupardhi profile image
priyanshu pardhi

Thanks for sharing

Collapse
 
bellatrix profile image
Sakshi

helpful!