gpt4 book ai didi

maven - 如何避免警告消息 "already attached to project, ignoring duplicate"

转载 作者:行者123 更新时间:2023-12-04 03:19:18 26 4
gpt4 key购买 nike

我试图避免来自程序集插件的 maven 警告消息(我编译了 2 个从同一模块编译的 jar 文件)

我的 pom.xml 的一部分:

maven-jar-插件 2.3.1 默认 jar 没有任何

    <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<executions>
<execution>
<id>MockFX</id>
<configuration>
<finalName>MockFX</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>mock.DSlauncher.FX.FX_DataSourceLauncher</mainClass>
</manifest>
</archive>
</configuration>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>

<execution>
<id>MockFutures</id>
<configuration>
<finalName>MockFutures</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>mock.DSlauncher.Futures.Futures_DataSourceLauncher</mainClass>
</manifest>
</archive>
</configuration>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

在编译过程中,我收到下一条警告消息:

[WARNING] Artifact com.my.company:UAT-Mock:jar:jar-with-dependencies:1.0 already attached to project, ignoring duplicate

为了避免警告,我应该向 pom.xml 添加什么?

谢谢

最佳答案

只需添加 <attach>false</attach>到两个执行的配置

关于maven - 如何避免警告消息 "already attached to project, ignoring duplicate",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39314801/

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