gpt4 book ai didi

java - Maven jar-with-dependencies 不会覆盖文件

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:32:32 26 4
gpt4 key购买 nike

我的 pom.file 中有这个插件:

      <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.doesntwork.App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>

到现在为止一切正常。目前,我的两个依赖项使用 META-INF 中某个文件的相同文件名来存储一些数据。不幸的是,插件不会合并文件,它只是用第二个文件覆盖第一个文件,这导致我的应用程序崩溃。

我可以强制 maven 合并恰好具有相同名称(但来自不同依赖项)的文件吗?

最佳答案

maven-shade-plugin我认为它的变形金刚正合你意。

关于java - Maven jar-with-dependencies 不会覆盖文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12153970/

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