Previous – Chapter 3

Maven Tutorial – Chapter 4

What is Maven Repository?

For maven to download the required artifacts of the build and dependencies (jar files) and other plugins which are configured as part of any project, there should be a common place where all such artifacts are placed. This common shared area is called as Repository in maven.

Maven repository is classified into 3 main categories as shown below:

[xml]
<settings xmlns=<em>"http://maven.apache.org/SETTINGS/1.0.0"</em> xmlns:xsi=<em>"http://www.w3.org/2001/XMLSchema-instance"</em>
xsi:schemaLocation=<em>"http://maven.apache.org/SETTINGS/1.0.0         http://maven.apache.org/xsd/settings-1.0.0.xsd"</em>>
<localRepository>D:/m2repo</localRepository>
</settings>
[/xml]

[xml]
<repositories>
     <repository>
         <id>remote.repository</id>
        <url>http://download.ogrname.com/maven2/</url>
    </repository>
</repositories>
[/xml]

[xml]
<repositories>
     <repository>
         <id>central.repository</id>
         <url>http://repo1.maven.org/maven2/</url>
     </repository>
</repositories>
[/xml]

Organization of local and remote/central repositories

 

image

How does maven searches for dependencies?

Basically, when maven starts executing the build commands, maven starts for searching the dependencies as explained below:

 Next – Chapter 5

Leave a Reply

Your email address will not be published. Required fields are marked *