According to Apache Maven :

Downloading in Maven is triggered by a project declaring a dependency that is not present in the local repository (or for a SNAPSHOT, when the remote repository contains one that is newer). By default, Maven will download from the central repository.

In Maven, when you need some libraries that are NOT EXITS the Maven center repository, the process will stopped and output error messages to your Maven console.

Example

The org.jvnet.localizer library is not available at Maven central repository, but Maven remote repository, which is http://download.java.net/maven/2/.

    <dependency>
      <groupId>org.jvnet.localizer</groupId>
      <artifactId>localizer</artifactId>
      <version>1.8</version>
    </dependency>

To tell Maven to go to Maven remote repository like java.net, you need to declared a “remote repository” in your Maven’s pom.xml file like this :

  <repositories>
    <repository>
      <id>java.net</id>
      <url>http://download.java.net/maven/2</url>
    </repository>
  </repositories>

Now, Maven’s dependency libraries look-up sequences is changed to :

  1. Search in Maven local repository, if not found, continue step 2, else exit.
  2. Search in Maven central repository, if not found, continue step 3, else exit.
  3. Search in java.net Maven remote repository – , if not found, prompt error message, else exit.
Any Java questions or problems? please post at this JavaNullPointer.com forum, see you there ~
[ Read More ] You can find more similar articles at Maven Tutorials