dest文件名被 mvn install dependency:copy-dependencies 忽略



我正在尝试更改使用此命令复制依赖项时 jar 的本地文件夹和名称mvn install dependency:copy-dependencies

dest文件名似乎被maven忽略了。尽管 outputDirectory 确实正确地将其放入该目录中,但 jar 名称并未更改 - 它与存储库中的名称相同。我想在复制时完全更改罐子的名称

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- required by not used -->
<groupId>aaaa</groupId>
<artifactId>aaaaa</artifactId>
<version>5</version>
<repositories>
<repository>
<id>my-repo</id>
<name>repo</name>
<url>https://my-repo</url>
</repository>
</repositories>
<!-- require uber-jar -->
<dependencies>
<dependency>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<classifier>uber-jar</classifier>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>Jars</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<classifier>uber-jar</classifier>
<overWrite>true</overWrite>

<!-- THIS IS IGNORED -->
<destFileName>zzzzzz.jar</destFileName>

</artifactItem>
</artifactItems>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</plugin>
</plugins>
</build>
</project>

好的,我想我可能有答案 复制依赖项似乎没有 dest文件名

复制依赖

关系但目标副本有它

复制

我有一个类似的问题,你可以尝试使用复制依赖项中的<stripVersion>选项

希望对你有帮助

最新更新