我有以下配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>analyze</id>
<goals>
<goal>analyze-only</goal>
</goals>
<configuration>
<failOnWarning>false</failOnWarning>
</configuration>
</execution>
<!--Copy the dependencies so ant build has the same versions-->
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<stripVersion>true</stripVersion>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<excludeTransitive>false</excludeTransitive>
</configuration>
</execution>
</executions>
</plugin>
上述配置将所有内容转储到同一文件夹中。我尝试通过添加测试配置来排除测试范围,但出现错误:
无法在项目 pcgen 上执行目标 org.apache.maven.plugins:maven-dependency-plugin:2.6:copy-dependencies (copy-dependencies):无法排除测试范围,这将排除所有内容。
有没有办法将测试依赖项与其他依赖项分开,以便我可以复制到不同的文件夹?