---
title: "Maven拷贝依赖包"
author: "leonmau"
date: "2011-12-06T11:17:28Z"
tags: []
categories: ["开源软件"]
slug: "maven"
draft: false
lastmod: "2011-12-06T11:17:28Z"
id: 1293569
url: "https://leonmau.iteye.com/blog/1293569"
---

Maven将依赖的包拷贝到指定目录

```
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>true</overWriteSnapshots>
							<includeScope>runtime</includeScope>
						</configuration>
					</execution>
				</executions>
			</plugin>
```