• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Maven | maven-dependency-plugin
  1. Maven Dependency Plugin (3.4.0)
  2. The goal help
  3. Example: Using dependency plugin

  1. Maven Dependency Plugin (3.4.0)
    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:
  2. The goal help
    The goal help gives general information about the dependency plugin and lists its goals.
    The parameter detail gives detailed information about the parameters of the goals of the dependency plugin.

    If you need to use the plugin's coordinates instead of its prefix, you can do that as following:

    You can also use the goal describe of the help plugin to get information about the dependency plugin and lists its goals:

    The parameter goal gives information about a goal of the dependency plugin:
  3. Example: Using dependency plugin
    Adjust your pom file with the following:
© 2025  mtitek