Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use a maven repository manager

Tags:

maven

maven-3

I've been using maven since a year for managing my projects' dependencies, but I recently came to know that there is a concept of Maven Repository Manager.
I would like to ask What is a Maven Repository Manager and what is the purpose of using maven repository manager.

like image 853
Shivani Garg Avatar asked Nov 13 '15 05:11

Shivani Garg


People also ask

What is the best practice for Maven repository management?

Best Practice - Using a Repository Manager. A repository manager is a dedicated server application designed to manage repositories of binary components. The usage of a repository manager is considered an essential best practice for any significant usage of Maven. A repository manager serves these essential purposes:

What is the use of Maven?

Maven is a project build tool which comes under the license of Apache, and there are whole hosts of libraries available in the Maven repository. In a project, getting the right JAR files is a difficult task where there could be conflicts in the versions of the two separate packages.

What is a repository manager?

A repository manager is a dedicated server application designed to manage repositories of binary components. The usage of a repository manager is considered an essential best practice for any significant usage of Maven. A repository manager serves these essential purposes:

Why do I need a version/source control management repository?

I use a Version/Source Control Management repository to store my source code. Why do I need a Repository Manager for my binaries? As DZone’s Refcard on Using Repository Managers concisely states, “Repository Managers are to binaries what source repositories or VCS (Version Control Systems) are to sources.”


1 Answers

A "Maven Repository Manager" is basically a server that stores copies of all of your libraries so that they can be downloaded when a project is built. When you use Maven, you are using a repository manager already called "Maven Central." See here: https://maven.apache.org/repository-management.html

When you are working with a large project or corporation, they may host an alternative to Maven Central, like Sonatype Nexus. There are two reasons why they do.

First, a big corporation might have libraries that are intended only for internal use that are used across a large number of projects. For example, if you worked at Amazon, you might have libraries for completing credit card transactions. That shouldn't necessarily be shared with the rest of the world, so you don't want to put it in Central; you need to put it someplace private.

Second, it reduces bandwidth. If every developer at Amazon only used Maven Central, then that would be lots of network traffic. A repository acts as a "proxy" to Central. It searches internally for a library, and then if it doesn't find it, it downloads it from Central and then saves it for the next time someone asks for it.

like image 86
Brad Avatar answered Oct 23 '22 03:10

Brad