mtitek
  • Cloud
  • Big Data
  • CI
  • Install
  • Samples
  • Java
  • Ubuntu
  • Maven
  • Archive
Maven | maven-dependency-plugin
  1. Help
  2. Example: Using jar goals in the project POM file

  1. Help
    Name: Apache Maven Dependency Plugin

    Description: The Apache Maven Dependency plugin provides goals to manage dependencies.
    It provides utility goals to work with dependencies like copying, unpacking, analyzing, resolving and many more.

    Plugin coordinates:
    Group Id: org.apache.maven.plugins
    Artifact Id: maven-dependency-plugin
    Version: 3.1.1

    Goal Prefix: dependency

    The goal help:help gives general information about the dependency plugin and lists its goals:

    The goal help:describe gives detailed information about the dependency and lists its goals:

    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-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.

    • 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. Example: Using jar goals in the project POM file
© 2020  mtitek