2016-04-06 41 views
0

使用裝配插件時,在嘗試從Maven項目生成兩個或多個罐子時遇到了一些麻煩。未能在maven中構建多個程序集。找不到裝配描述符

我有以下maven pom.xml文件(見下文)。

然而,當我運行mvn clean compile assembly:single

我得到以下錯誤: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project hyuga: Error reading assemblies: No assembly descriptors found. -> [Help 1]

我缺少什麼?

<plugin> 
    <artifactId>maven-assembly-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>dg2cep</id> 
      <configuration> 
       <archive> 
        <manifest> 
         <mainClass>br.pucrio.inf.lac.konoha.hyuga.core.Bootstrap</mainClass> 
        </manifest> 
       </archive> 
       <descriptorRefs> 
        <descriptorRef>jar-with-dependencies</descriptorRef> 
       </descriptorRefs> 
       <finalName>dg2cep</finalName> 
      </configuration> 
      <phase>package</phase> <!-- bind to the packaging phase --> 
      <goals> 
       <goal>single</goal> 
      </goals> 
     </execution> 
     <execution> 
      <id>playback</id> 
      <configuration> 
       <archive> 
        <manifest> 
         <mainClass>br.pucrio.inf.lac.konoha.hyuga.others.csv.CSVPlayback</mainClass> 
        </manifest> 
       </archive> 
       <descriptorRefs> 
        <descriptorRef>jar-with-dependencies</descriptorRef> 
       </descriptorRefs> 
       <finalName>playback</finalName> 
      </configuration> 
      <phase>package</phase> <!-- bind to the packaging phase --> 
      <goals> 
       <goal>single</goal> 
      </goals> 
     </execution> 
    </executions> 
</plugin> 
+0

首先使用maven-assembly-plugin的最新版本,因爲這個版本比古代版本更新...當前版本是2.6 http://maven.apache.org/plugins/ – khmarbaise

+0

@khmarbaise,沒有運氣: 在此處查看輸出: '' [INFO] ------------------- -------------------------------------------------- --- [錯誤]未能執行目標org.apache.maven.plugins:項目中的maven-assembly-plugin:2.6:single(default-cli)hyuga:讀取程序集時出錯:找不到程序集描述符。 - > [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException:無法執行目標org.apache.maven.plugins:項目中的maven-assembly-plugin:2.6:single(default-cli)hyuga:讀取程序集時出錯:沒有發現裝配描述符.'' –

+0

Ah..you正在執行它:'mvn ... assembly:single'?如果不這樣做,請在生命週期內使用它,例如'mvn clean package' .... – khmarbaise

回答

1

啊..你正在執行它,像這樣:mvn ... assembly:single?如果不這樣做,請在生命週期內使用它,如mvn clean package ....

相關問題