Maven Dependency Plugin

This page provides a space for users to contribute examples, errata, tips and other useful information about the Maven Dependency Plugin. Everybody is invited to share his/her thoughts about the plugin to help the community to improve it.

Note: Please do not use this page to report bugs or feature requests. Instead, please fill in an issue in the issue tracking system listed in the official plugin documentation.

Thanks!

– The Maven Team

Examples

Doing this and that:

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.0</version>
        <configuration>
           <!-- your example configuration here -->
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

FAQ

How do I ...?

Make the dependency plugin download a dependency using the get goal?

The problem is that when you follow the plugin's instructions for the get goal, and provide the repositoryUrl parameter, the plugin may fail (at least on Ubuntu 10.10 with Maven 3.0.2/3.0.3 and plugin version 2.1/2.2).

Example:

$ mvn dependency:get -Dartifact=com.google.guava:guava:r08 -DrepositoryUrl=http://repo1.maven.org/maven2/

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.2:get (default-cli) on project foo:
The parameters 'repositoryUrl' for goal org.apache.maven.plugins:maven-dependency-plugin:2.2:get are
missing or invalid -> [Help 1]

A work-around for this problem is to not use repositoryUrl and instead use repoUrl to specify the repository.