maven - 引用本地jar,进行jar包移动

时间:2024-10-09 14:33:15

背景:

  项目为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