我正在尝试使用maven-dependency-plugin:unpack-dependencies
解开依赖关系。
根据他们的docs,它应该支持stripVersion
。
我的POM摘录:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includes>**/*.yaml</includes>
<includeGroupIds>com.foo.group</includeGroupIds>
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
<stripVersion>true</stripVersion> <!-- doesnt have any effect -->
</configuration>
</execution>
</executions>
</plugin>
依赖关系会被解压缩,但不会位于所需的文件夹结构中。
这就是我得到的
/test-classes/META-INF/<group>/<artifactId>/<version>/files...
这至少是我需要的
/test-classes/META-INF/<group>/<artifactId>/files...
当我在stripVersion
mojo上使用maven-dependency-plugin:copy
时,它会执行文档说明的内容,复制提及的依赖项,并从生成的jarfile中剥离版本。
任何人都可以阐明一下,为什么stripVersion无法在unpack-dependencies
上运行,或者我在做什么错吗?