In some cases, we’d like to get all the dependency jar files for a project. There is a maven plugin to do it simply, via a simple way. Just add the build sections to your pom file, as shown below:
-
-
<project>
-
<!– ……. –>
-
<build>
-
<plugins>
-
<plugin>
-
<groupId>org.apache.maven.plugins</groupId>
-
<artifactId>maven-dependency-plugin</artifactId>
-
<executions>
-
<execution>
-
<id>copy-dependencies</id>
-
<phase>process-sources</phase>
-
<goals>
-
<goal>copy-dependencies</goal>
-
</goals>
-
<configuration>
-
<outputDirectory>c:\output</outputDirectory>
-
<overWriteReleases>false</overWriteReleases>
-
<overWriteSnapshots>false</overWriteSnapshots>
-
<overWriteIfNewer>true</overWriteIfNewer>
-
</configuration>
-
</execution>
-
</executions>
-
</plugin>
-
</plugins>
-
</build>
-
-
<!– ……. –>
-
-
</project>
-