Apache

Docs Plugins

Dependency Plugin 3.11.0 · Other versions

Provides utility goals to work with dependencies like copying, unpacking, analyzing, resolving and many more.

Source
Edit this page
Wrong?
Report a problem

Unpacking project dependencies

This is pretty similar to the Copying direct dependencies example. The difference is that the direct dependencies are unpacked, including the transitive dependencies. To unpack the artifacts, use the dependency:unpack-dependencies mojo and configure the dependency plugin to something like the sample below:

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.11.0</version>
        <executions>
          <execution>
            <id>unpack-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includes>**/*.class</includes>
              <excludes>**/*.properties</excludes>
              <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>