I have a multi-module maven project. One of the modules uses maven-assembly-plugin. When running mvn clean install on the whole project, the build fails with GC Overhead limit exceeded error.
I am using maven 3.3.9 (tried also with 3.2.2). The maven-assembly-plugin is in version 2.5.5 (tried also with 2.6). Here is the plugin configuration:
<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>
I have even set MAVEN_OPTS to following, but didn't help:
MAVEN_OPTS="-Xms2048m -Xmx4096m -XX:PermSize=1024m"
The last message before failing is:
Cleaning up unclosed ZipFile for archive .../.m2/repository/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar
Moving to maven-assempbly-plugin version 3.2.0 solved it for me and sped up the build significantly
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.2.0</version>
.....
Suffering with exactly the same problem, I've got it working by simply increasing max heap space to: -Xmx6g
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With