Maven Dependency Plugin
The dependency plugin provides the capability to manipulate artifacts. It can copy and/or unpack artifacts from local or remote repositories to a specified location.
Goals Overview
The Dependency plugin has several goals:
- dependency:copy
takes a list of artifacts defined in the plugin configuration section and copies them to a specified location, renaming them or stripping the version if desired. This goal can resolve the artifacts from remote repositories if they don't exist in local.
- dependency:copy-dependencies
takes the list of project direct dependencies and optionally transitive dependencies and copies them to a specified location, stripping the version if desired. This goal can also be run from the command line.
- dependency:unpack
like copy but unpacks.
- dependency:unpack-dependencies
like copy-dependencies but unpacks.
- dependency:resolve
tells Maven to resolve all dependencies and displays the version.
- dependency:list
is an alias for dependency:resolve
- dependency:sources
tells Maven to resolve all dependencies and their source attachments, and displays the version.
- dependency:resolve-plugins
Tells Maven to resolve plugins and their dependencies.
- dependency:list
alias for resolve that lists the dependencies for this project.
- dependency:go-offline
tells Maven to resolve everything this project is dependent on (dependencies, plugins, reports) in preparation for going offline.
- dependency:purge-local-repository
tells Maven to clear all dependency-artifact files out of the local repository, and optionally re-resolve them.
- dependency:build-classpath
tells Maven to output the path of the dependencies from the local repository in a classpath format to be used in java -cp. The classpath file may also be attached and installed/deployed along with the main artifact.
- dependency:analyze
analyzes the dependencies of this project and determines which are: used and declared; used and undeclared; unused and declared.
- dependency:analyze-only
is the same as analyze, but is meant to be bound in a pom. It does not fork the build and execute test-compile.
- dependency:analyze-dep-mgt
analyzes your projects dependencies and lists mismatches between resolved dependencies and those listed in your dependencyManagement section.
- dependency:tree
displays the dependency tree for this project.
Usage
- Instructions on how to use the dependency plugin can be found here
.
Examples
The following examples show how to use the dependency plugin in more advanced use-cases:
Resources
Here is a link that provides more reference regarding dependencies (i.e. dependency management, transitive dependencies).