gpt4 book ai didi

maven-dependency-plugin - 在复制依赖项之前删除旧的工件版本

转载 作者:行者123 更新时间:2023-12-04 17:21:57 25 4
gpt4 key购买 nike

我使用 maven-dependency-plugin 将当前工件复制到自定义目录中:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-to-dsf-server</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${tomcat.dsf.dir}/lib/pacifisc</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

但是当工件版本更改时,我将同一 jar 的两个版本放入目标目录。如何删除旧版本?

问候,
阿诺

最佳答案

我终于使用了 maven-clean-plugin :

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>clean-dsf-server</id>
<phase>package</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<filesets>
<directory>${tomcat.dsf.dir}/lib/pacifisc</directory>
<includes>
<include>${project.artifactId}*.jar</include>
</includes>
</filesets>
</filesets>
</configuration>
</execution>
</executions>
</plugin>

关于maven-dependency-plugin - 在复制依赖项之前删除旧的工件版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21566352/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com