我使用 maven-dependency-plugin 插件来解包依赖项。
运行时,我可以在目标/依赖项下看到解压的 jars(编译阶段需要的那些)
mvn 依赖项:解包依赖项
但是如果我跑
mvn 干净安装
我得到编译错误。
我怎么能让 maven 知道这些解压后的 jar 在编译和安装时要使用?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.group</includeGroupIds>
<includeArtifactIds>zippedArtifact</includeArtifactIds>
<includes>x.jar,y.jar</includes>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>