LibraryLink ToToggle FramesPrintFeedback

Locating Maven Artifacts at Build Time

This section explains how Maven locates artifacts at build time. Essentially, Maven implements a simple caching scheme: artifacts are downloaded from remote repositories on the Internet and then cached in the local repository. Figure 11.1 shows an overview of the procedure that Maven follows when locating artifacts at build time.


While building a project, Maven locates required artifacts (dependencies, required plugins, and so on) as follows:

You can configure the following kinds of repository for locating Maven artifacts at build time:

Maven resolves the location of the local repository, by checking the following settings:

Maven enables you to specify the location of internal repositories either in your settings.xml file (which applies to all projects) or in a pom.xml (which applies to that project only). Typically, the location of an internal repository is specified using either a file:// URL or a http:// URL (assuming you have set up a local Web server to serve up the artifacts) and you should generally ensure that internal repositories are listed before remote repositories. Otherwise, there is nothing special about an internal repository: it is just a repository that happens to be located in your internal network.

For an example of how to specify a repository in your settings.xml file, see Adding the fusesource repository.

Remote repositories are configured in the same way as internal repositories, except that they should be listed after any internal repositories.