Provides utility goals to manage and work with dependencies like copying, unpacking, analyzing, resolving and many more.
Plugin coordinates:
- Group Id: org.apache.maven.plugins
- Artifact Id: maven-dependency-plugin
Plugin Prefix: dependency
The
dependency plugin has the following goals:
-
help:
Displays help information on maven-dependency-plugin.
Call mvn dependency:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
-
analyze:
Analyzes the dependencies of this project and determines which are: used and declared; used and undeclared; unused and declared.
-
analyze-dep-mgt:
This mojo looks at the dependencies after final resolution and looks for mismatches in your dependencyManagement section.
-
analyze-duplicate:
Analyzes the <dependencies/> and <dependencyManagement/> tags in the pom.xml and determines the duplicate declared dependencies.
-
analyze-only:
Analyzes the dependencies of this project and determines which are: used and declared; used and undeclared; unused and declared.
-
analyze-report:
Analyzes the dependencies of this project and produces a report that summarizes which are: used and declared; used and undeclared; unused and declared.
-
resolve:
Goal that resolves the project dependencies from the repository.
-
resolve-plugins:
Goal that resolves all project plugins and reports and their dependencies.
-
tree:
Displays the dependency tree for this project.
-
list:
Displays the list of dependencies for this project.
-
list-classes:
Retrieves and lists all classes contained in the specified artifact from the specified remote repositories.
-
list-repositories:
Goal that resolves all project dependencies and then lists the repositories used by the build and by the transitive dependencies.
-
display-ancestors:
Displays all ancestor POMs of the project.
-
sources:
Goal that resolves the project source dependencies from the repository.
-
copy:
Goal that copies a list of artifacts from the repository to defined locations.
-
copy-dependencies:
Goal that copies the project dependencies from the repository to a defined location.
-
collect:
Collects the project dependencies from the repository.
-
unpack:
Goal that retrieves a list of artifacts from the repository and unpacks them in a defined location.
-
unpack-dependencies:
Goal that unpacks the project dependencies from the repository to a defined location.
-
purge-local-repository:
Removes the project dependencies from the local repository, and optionally re-resolves them.
-
build-classpath:
This goal will output a classpath string of dependencies from the local repository to a file or log.
-
get:
Resolves a single artifact, eventually transitively, from the specified remote repositories.
-
go-offline:
Goal that resolves all project dependencies, including plugins and reports and their dependencies.
-
properties:
Goal that sets a property pointing to the artifact file for each project dependency.
Here are some examples of
maven-dependency-plugin usage: