Local and remote repositories
Maven manages two types of dependency repositories:
Local repository
Local disk location where Maven stores downloaded dependencies, so that they do not have to be downloaded every time. The structure corresponds to one folder per groupId (if the groupID contains points, a subfolder will be created for each element), a folder with the name of the artifactId and finally, a folder with the version.
The downloaded dependencies are stored in the folder of the version. For example, see the following dependency in a pom.xml:
<dependency> <groupId>org.gvsig</groupId> <artifactId>org.gvsig.tools</artifactId> <version>2.0-SNAPSHOT</version> </dependency>
This will be stored in the local Maven repository with the path:
MAVEN_REPO/org/gvsig/org.gvsig.tools/2.0-SNAPSHOT/org.gvsig.tools-2.0-SNAPSHOT.jar
The files stored by Maven in the local repository can be of type:
- pom.xml: the configuration and dependencies of the dependency. In this way, Maven will download the entire tree of dependencies that is needed at any given time so that we don’t have to specify the dependencies of a dependency of our project.
- .jar file with compiled classes.
- .jar file with source code.
- .jar file with javadoc.
- etc.
When specifying a dependency for our project, Maven will by default download only the .jar file with the compiled classes. However, we can specify that the .jar with the source code and / or the javadoc must be downloaded as well.
Remote repositories
Remote repositories are dependency servers where Maven will look when it cannot find a dependency in the local repository.
Common remote repositories that can be accessed via standard protocols are HTTP/S, FTP, SSH, etc.
The Maven project itself has a dependency repository, accessible by HTTP, which is configured by default. In the pom.xml files you can add other external repositories, or repositories of your own project. For example, gvSIG has its own repository, which is registered by default for the gvSIG projects, in addition to the official repositories.
The gvSIG repository is currently accessible through HTTP as read-only, and through SCP in editing mode. This repository contains mainly the files that are generated by the gvSIG projects, as well as any external dependencies that are not available in the official repository.