2016-09-04 24 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>既執行