maven 拷贝所有依赖到指定目录

<plugin>
           <artifactId>maven-dependency-plugin</artifactId>
           <executions>
             <execution>
               <phase>package</phase>
               <goals>
                 <goal>copy-dependencies</goal>
               </goals>
               <configuration>
                 <outputDirectory>${project.build.directory}/lib</outputDirectory>
               </configuration>
             </execution>
           </executions>
         </plugin>

 

其中 ${project.build.directory}是指当前工程的target目录,运行package则会将所有依赖包拷贝到lib目录下。

 

参见:

http://stackoverflow.com/questions/97640/force-maven2-to-copy-dependencies-into-target-lib


Total views.

© 2013 - 2024. All rights reserved.

Powered by Hydejack v6.6.1