Working with Maven Repositories
See Also
Software library archives (JARs), build artifacts and dependencies
that are used to build Maven projects are stored in repositories.
There are two types of repositories:
- Local repositories. A cache of a remote
repository that is stored on the local machine.
Maven projects are built against the local repository.
The local repository usually only stores a subset of the files
available in the remote repository and any temporary build artifacts.
- Remote repositories. A central repository
that contains all the Maven artifacts and plugins.
The remote repository may be a third-party repository
(e.g. http://repo1.maven.org/),
or it may be a private internal repository.
The IDE indexes the contents of local and remote Maven repositories using the Nexus indexing engine.
The IDE uses the repository indexes for some Maven-related functions such as code completion.
You can browse and manage the indexes in the Maven Repositories window.
To browse Maven repositories
- Choose Window > Other > Maven Repository Browser to open the Maven Repositories window.
- Expand the nodes in the window to view the contents of the repositories.
The Maven Repositories window lists the Maven repositories registered with the IDE and
enables you to add, remove and update Maven repositories.
The local Maven repository is indicated by a yellow repository node
(
)
and remote repositories are indicated by blue repository nodes
(
).
- By default the IDE includes the central Maven repository in the list
of remote repositories.
When a project requires build artifacts that are not stored in the local repository,
Maven downloads the required artifacts to the local repository from a remote repository.
The files in the local Maven repository are then shared by all your Maven projects.
The Maven Repositories window contains the following buttons for working with repositories.
Button |
Description |
 | Updates Indexes.
Click this to reindex the local repository and update the indexes for the remote repositories. |
 | Add repository.
Click this to open the Add Repository dialog box where you can specify the details
for the new repository. |
 | Find.
Click this to open the Find in Repositories dialog box.
Enter a term to search the repositories for artifacts containing the term. |
You can expand the repository nodes to view the indexed artifacts grouped by GroupId and ArtifactId,
the version of the library sources and the type of packaging.
Depending on the metadata available, you can right-click a library to perform various actions.
- Add As Dependency to. Choose this to add the library to an open project as a dependency.
The IDE automatically modifies the project's pom.
- Find Usages. Choose this to view open projects and repository artifacts that use
the selected library as a dependency.
- View JavaDoc.
- Open Project Home Page. If available, opens the project home page for the library in your browser.
- Open Bug Tracker. If available, opens the bug tracking page for the library in your browser.
- SCM. If available, you can choose this to browse the sources online or checkout the sources.
If you choose to checkout the sources, you will be prompted to specify either a
remote or local repository and to supply the checkout details.
Sources are checked out from the repository using Maven SCM.
- See Also
- About Working with Maven
Legal Notices