Maven repositories 

Joined:
08/13/2009
Posts:
172

January 23, 2011 19:28:35    Last update: October 28, 2011 12:10:07
Maven repositories are a central part of the Maven build system. Maven resolves dependencies through repositories. There are two types of repositories: local and remote.

The local repository stores local build artifacts (when you do mvn install) and caches artifacts from remote repositories. It is usually located on the local file system at $USER_HOME/.m2/repository.

Remote repositories are located on the network and accessed by URLs (http:// or file:// etc). The central Maven repository is: repo1.maven.org. The Java EE repositories are located at: http://download.java.net/maven/2/ and http://download.java.net/maven/1/. Remote repositories can also be set up on the company intranet within a company's firewall.

The central repository is automatically configured after installation. You can add additional repositories in settings.xml, for example:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
    <profiles>
        <profile>
            <id>DefaultProfile</id>

            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

	    <repositories>
		<repository>
		    <id>maven2-repository.dev.java.net</id>
		    <name>Java.net Repository for Maven</name>
		    <url>http://download.java.net/maven/2/</url>
		    <layout>default</layout>
		</repository>
	    </repositories>
	</profile>
    </profiles>
</settings>


You can search for dependency groupId/artifactId/version with the Maven Central Search Engine.
Share |
| Comment  | Tags