如何避免警告消息“已附加到项目,忽略重复”

时间:2016-09-04 08:02:10

标签: maven maven-assembly-plugin

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

我的pom.xml的一部分:

                          Maven的JAR-插件             2.3.1                                                   默认情况下,罐子                     没有                                       

    <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添加什么以避免警告?

由于

1 个答案:

答案 0 :(得分:1)

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

即可