Maven remote warehouse jar package download

In Maven, what should I do when the jar package you declare does not exist in the local repository and does not exist in the Maven central repository?

1. Example

 org.jvnet.localizer only works with repositories





When you build this Maven project, it will fail to find dependencies and output an error message.

2. Declare the repository

To tell Maven to get dependencies, you need to declare the remote repository in the pom.xml file like this:



With this setup, the Maven dependency library query becomes the following sequence:

  1. Search in the Maven local repository, no, go to step 2, otherwise exit.
  2. Search in Maven Central Repository, none, go to step 3, otherwise exit.
  3. Search in Maven's remote repository, none, prompt an error message, otherwise exit.

Guess you like