Unpacking the Copied Direct Dependencies

This is pretty much alike with Copying Direct Dependencies example. The difference is that the copied direct dependencies has been unpacked, including the transitive dependencies. To unpack the copied 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>
        <executions>
          <execution>
            <id>unpack-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>