Jul 05

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:

  1.  
  2. <project>
  3. <!– ……. –>
  4. <build>
  5.         <plugins>
  6.                 <plugin>
  7.                                 <groupId>org.apache.maven.plugins</groupId>
  8.                                 <artifactId>maven-dependency-plugin</artifactId>
  9.                                 <executions>
  10.                                         <execution>
  11.                                                 <id>copy-dependencies</id>
  12.                                                 <phase>process-sources</phase>
  13.                                                 <goals>
  14.                                                         <goal>copy-dependencies</goal>
  15.                                                 </goals>
  16.                                                 <configuration>
  17.                                                         <outputDirectory>c:\output</outputDirectory>
  18.                                                         <overWriteReleases>false</overWriteReleases>
  19.                                                         <overWriteSnapshots>false</overWriteSnapshots>
  20.                                                         <overWriteIfNewer>true</overWriteIfNewer>
  21.                                                 </configuration>
  22.                                         </execution>
  23.                                 </executions>
  24.                         </plugin>
  25.                         </plugins>
  26.         </build>
  27.  
  28. <!– ……. –>
  29.  
  30. </project>
  31.  
  • Share/Bookmark