2016-09-27 94 views
1

我有一個多模塊Maven項目。其中一個模塊使用maven-assembly-plugin。在整個項目中運行mvn clean install時,生成失敗,GC超出限制超出錯誤。Maven的組裝插件失敗,GC開銷超過限制

我使用maven 3.3.9(3.2.2也試過)。 maven-assembly-plugin是在2.5.5版本(也試用2.6)。下面是插件配置:

<plugin> 
    <artifactId>maven-assembly-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>dist-assembly</id> 
      <phase>package</phase> 
      <goals> 
       <goal>single</goal> 
      </goals> 
     </execution> 
    </executions> 
    <configuration> 
     <classifier>all</classifier>     
     <finalName>${project.artifactId}-${project.version}-all</finalName> 
     <attach>false</attach> 
     <appendAssemblyId>false</appendAssemblyId> 
     <archive> 
      <manifest> 
       <addClasspath>true</addClasspath> 
       <classpathPrefix>lib</classpathPrefix> 
       <mainClass>...my main class...</mainClass> 
      </manifest> 
      <manifestEntries> 
       <Implementation-Build>${buildNumber}</Implementation-Build> 
      </manifestEntries> 
     </archive> 
     <descriptorRefs> 
      <descriptorRef>jar-with-dependencies</descriptorRef> 
     </descriptorRefs> 
    </configuration> 
</plugin> 

我連一套MAVEN_OPTS到以下,但並沒有幫助:

MAVEN_OPTS="-Xms2048m -Xmx4096m -XX:PermSize=1024m" 

最後一條消息失敗前:

Cleaning up unclosed ZipFile for archive .../.m2/repository/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar 
+0

我看到幾乎相同的親瑕疵(添加bouncycastle庫時失敗) - 但只有當程序集作爲完整版本的一部分運行時纔會生效。如果我單獨運行程序集,它不會失敗。你解決了這個問題嗎? –

+0

不幸的不是。行爲與您所描述的完全相同。完整構建失敗,但是當我僅在包含程序集的一個模塊上運行構建時,它不會。 –

+0

以爲我用的是-d64開關 - 事實證明我已經恢復了比我更多的Git :( –

回答

0

苦難完全相同的問題,我已經得到了它的工作簡單地通過增加最大的堆空間:-Xmx6g

相關問題