To make libraries and projects available to your project during compilation, testing and execution you need to declare the projects or libraries as dependencies. All dependencies need to be available as artifacts in your local repository.
You declare a dependency by modifying the POM to add the coordinates of the artifact you want to declare as a dependency. All Maven artifacts are defined by a unique coordinate that consists of a group identifier (groupId), artifact identifier (artifactId) and version. Adding a dependency to the POM is similar to adding libraries to the classpath in an Ant-based project.
You can add a dependency to a Maven project in the following ways:
To open the Add Dependency dialog, right-click the Libraries node in the Projects window and choose Add Dependency. Alternatively, you can open the dialog by opening the Insert Code popup in pom.xml (Ctrl-I) and choosing Add Dependency.
After you add a dependency to pom.xml,
a node for the artifact ( )
appears under the project's Libraries node.
Artifacts that are not in your local repository are marked with a badge.
You need to have a copy of the artifact in your local repository if you
want to use it in your project.
This applies to libraries and to other projects that are described as dependencies.
Notes: