java - destFileName 被 mvn install dependency:copy-dependencies 忽略
问题描述
使用此命令复制依赖项时,我尝试更改本地文件夹和 jar 名称mvn install dependency:copy-dependencies
destFileName 似乎被 maven 忽略了。尽管 outputDirectory 确实将它正确地放在了该目录中,但 jar 名称并没有改变——它与 repo 中的名称相同。我想在复制下来时完全更改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>
解决方案
推荐阅读
- c#-4.0 - 使用 iText 7 打开带有非 ASCII 字符的受密码保护的 PDF 文件
- reactjs - 错误:列表中的每个孩子都应该有一个唯一的“关键”道具
- ssl - Traefik 使用成功在端口 443 和 8080 上生成 Let's Encrypt 证书?
- python - Int64Dtype 中断查询
- java - 使用Eclipse自定义Java类导入问题
- php - 如何使用 php cURL 从 url 下载 pdf?
- ag-grid - 类型“IFilterComp”上不存在属性“resetFilterValues”
- deployment - 使用 Airflow 实现零停机部署
- php - sendinblue 未连接到 API
- bash - 如何去混淆这个 shell 脚本?