首页 > 技术文章 > maven - 引用本地jar,进行jar包移动

YatHo 2017-04-24 19:51 原文

背景:

  项目为maven工程,部分jar需要需用项目单独修改的本地jar包。

  配置好scope后发现构建后引用的jar没有移动到对应的目录,百度后发现需要配置以下依赖

 

<plugin>  
	<groupId>org.apache.maven.plugins</groupId>  
	<artifactId>maven-dependency-plugin</artifactId>  
	<version>2.7</version>  
	<executions>  
		<execution>  
		<phase>package</phase>  
		<goals>  
			<goal>copy-dependencies</goal>  
		</goals>  
		</execution>  
	</executions>  
	<configuration>  
		<includeScope>system</includeScope>  
		<outputDirectory>bus/lib</outputDirectory>  
	</configuration>  
</plugin>  

  如报错:

  使用以下办法解决

解决maven-dependency-plugin (goals "copy-dependencies","unpack") is not supported

推荐阅读