2016-09-04 25 views
1

我试图避免来自组件插件在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的?

感谢

+0

你试图用一个描述符执行相同的目标''single' JAR-与-dependencies'产生相同文物的配置。您需要在其中一个执行中配置'< appendAssemblyId> false',并通过'第二个'设置分类器...... – khmarbaise

+0

@khmarbaise感谢您的回复,我添加了标记,但现在我得到下一个警告:配置选项:'appendAssemblyId'设置为false,'分类器'丢失。我也添加了分类标签,但它没有帮助,并且警告仍然存在 – Igal

回答

0

只需添加<attach>false</attach>既执行