有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java为什么stripVersion不能在带有mojo依赖项的mavendependencyplugin上工作

我正试图用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...

当我在maven-dependency-plugin:copymojo上使用stripVersion时,它执行文档所述的操作,复制提到的依赖项并从结果文件中剥离版本

谁能解释一下,为什么stripVersion不在unpack-dependencies上工作,或者我做错了什么


共 (0) 个答案