2017-05-05 60 views
0

我想用maven assembly插件構建tar文件,下面是相同的代碼片段。當我使用mvn install命令從CMD提示開始編譯時,然後生成tar文件,而不是從eclipse運行並獲取下面的日誌。注意: - Maven和JDK對於執行都是常見的。Maven assembly.xml不能從Eclipse中讀取

的pom.xml

<plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <configuration> 
       <descriptors> 
        <descriptor>assembly.xml</descriptor> 
       </descriptors> 
       <appendAssemblyId>false</appendAssemblyId> 
       <tarLongFileMode>gnu</tarLongFileMode> 
      </configuration> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals>       
         <goal>attached</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

Eclipse控制檯

[INFO] --- maven-assembly-plugin:2.2.1:attached (default) @ test --- 
[INFO] Assemblies have been skipped per configuration of the skipAssembly parameter. 
[INFO] 
[INFO] --- test-assembly-verifier:1.4:verify (default) @ test --- 
[INFO] Skipping assembly verification. 
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ test --- 
[INFO] Skipping artifact installation 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 

CMD控制檯

[INFO] --- maven-assembly-plugin:2.2.1:attached (default) @ test --- 
[INFO] Reading assembly descriptor: assembly.xml 
+0

我只能推測你正在用Eclipse運行Maven,其中包含一些關閉該參數的啓動器。除此之外,如果沒有完整的pom文件,很難看到發生了什麼。此外,我不知道那種插件'test-assembly-verifier'正在那裏運行,它的目的是什麼?除此之外,這些插件版本有點過時....順便說一句:這篇文章的標題是誤導性的問題是,通過eclipse執行時會跳過某些內容,但描述符被正確讀取...... – khmarbaise

回答