org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.0.0:jar-no-fork (generate-source-jar) on project etl-executor-impl: Error creating source archive: Problem creating jar: Execution exception

Apache's JIRA Issue Tracker | Stephan Schroevers | 10 months ago
  1. 0

    After upgrading from version 2.4 to 3.0.0 our aggregate build (comprising 52 jar/war modules) started failing when run on Travis CI: {noformat} [ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.0.0:jar-no-fork (generate-source-jar) on project etl-executor-impl: Error creating source archive: Problem creating jar: Execution exception: Java heap space -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.0.0:jar-no-fork (generate-source-jar) on project etl-executor-impl: Error creating source archive: Problem creating jar: Execution exception at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:188) at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:184) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating source archive: Problem creating jar: Execution exception at org.apache.maven.plugins.source.AbstractSourceJarMojo.packageSources(AbstractSourceJarMojo.java:311) at org.apache.maven.plugins.source.AbstractSourceJarMojo.packageSources(AbstractSourceJarMojo.java:253) at org.apache.maven.plugins.source.AbstractSourceJarMojo.execute(AbstractSourceJarMojo.java:216) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 11 more Caused by: org.codehaus.plexus.archiver.ArchiverException: Problem creating jar: Execution exception at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:982) at org.apache.maven.archiver.MavenArchiver.createArchive(MavenArchiver.java:650) at org.apache.maven.plugins.source.AbstractSourceJarMojo.packageSources(AbstractSourceJarMojo.java:303) ... 15 more Caused by: java.io.IOException: Execution exception at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.close(AbstractZipArchiver.java:807) at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:969) ... 17 more Caused by: java.lang.OutOfMemoryError: Java heap space at org.codehaus.plexus.archiver.zip.ByteArrayOutputStream.needNewBuffer(ByteArrayOutputStream.java:121) at org.codehaus.plexus.archiver.zip.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:90) at org.codehaus.plexus.archiver.zip.OffloadingOutputStream.<init>(OffloadingOutputStream.java:109) at org.codehaus.plexus.archiver.zip.OffloadingOutputStream.<init>(OffloadingOutputStream.java:89) at org.codehaus.plexus.archiver.zip.DeferredScatterOutputStream.<init>(DeferredScatterOutputStream.java:28) at org.codehaus.plexus.archiver.zip.ConcurrentJarCreator$DeferredSupplier.get(ConcurrentJarCreator.java:47) at org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator.createDeferred(ParallelScatterZipCreator.java:75) at org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator.access$100(ParallelScatterZipCreator.java:54) at org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator$1.initialValue(ParallelScatterZipCreator.java:84) at org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator$1.initialValue(ParallelScatterZipCreator.java:80) at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:180) at java.lang.ThreadLocal.get(ThreadLocal.java:170) at org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator$2.call(ParallelScatterZipCreator.java:175) ... 4 more {noformat} I managed to reproduce this locally by comparing the following two commands: {noformat} # Runs fine in under 10 seconds MAVEN_OPTS=-Xmx128m mvn -e org.apache.maven.plugins:maven-source-plugin:2.4:jar # Fails already after the third module with source code, after some 7 seconds MAVEN_OPTS=-Xmx128m mvn -e org.apache.maven.plugins:maven-source-plugin:3.0.0:jar {noformat} Our project is closed-source, but I verified the issue can also be reproduced on a large Maven build such as the one of the [Jetty|https://github.com/eclipse/jetty.project] project.

    Apache's JIRA Issue Tracker | 10 months ago | Stephan Schroevers
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.0.0:jar-no-fork (generate-source-jar) on project etl-executor-impl: Error creating source archive: Problem creating jar: Execution exception
  2. 0

    OutOfMemory Exception : java heap space

    Google Groups | 6 months ago | deepak singh
    java.lang.OutOfMemoryError: Java heap space* *java.lang.OutOfMemoryError: Java heap space*
  3. 0

    OutOfMemory Exception : java heap space

    Google Groups | 6 months ago | deepak singh
    java.lang.OutOfMemoryError: Java heap space* *java.lang.OutOfMemoryError: Java heap space*
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [exoplatform] [explatform] Memory requirements

    ow2.org | 1 year ago
    java.lang.OutOfMemoryError: Java heap space>java.lang.OutOfMemoryError: Java heap space
  6. 0

    OutOfMemory Exception : java heap space

    Google Groups | 6 months ago | deepak singh
    java.lang.OutOfMemoryError: Java heap space* *java.lang.OutOfMemoryError: Java heap space*

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.OutOfMemoryError

      Java heap space

      at org.codehaus.plexus.archiver.zip.ByteArrayOutputStream.needNewBuffer()
    2. Plexus Archiver Component
      ConcurrentJarCreator$DeferredSupplier.get
      1. org.codehaus.plexus.archiver.zip.ByteArrayOutputStream.needNewBuffer(ByteArrayOutputStream.java:121)
      2. org.codehaus.plexus.archiver.zip.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:90)
      3. org.codehaus.plexus.archiver.zip.OffloadingOutputStream.<init>(OffloadingOutputStream.java:109)
      4. org.codehaus.plexus.archiver.zip.OffloadingOutputStream.<init>(OffloadingOutputStream.java:89)
      5. org.codehaus.plexus.archiver.zip.DeferredScatterOutputStream.<init>(DeferredScatterOutputStream.java:28)
      6. org.codehaus.plexus.archiver.zip.ConcurrentJarCreator$DeferredSupplier.get(ConcurrentJarCreator.java:47)
      6 frames
    3. Apache Commons Compress
      ParallelScatterZipCreator$1.initialValue
      1. org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator.createDeferred(ParallelScatterZipCreator.java:75)
      2. org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator.access$100(ParallelScatterZipCreator.java:54)
      3. org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator$1.initialValue(ParallelScatterZipCreator.java:84)
      4. org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator$1.initialValue(ParallelScatterZipCreator.java:80)
      4 frames
    4. Java RT
      ThreadLocal.get
      1. java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:180)
      2. java.lang.ThreadLocal.get(ThreadLocal.java:170)
      2 frames
    5. Apache Commons Compress
      ParallelScatterZipCreator$2.call
      1. org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator$2.call(ParallelScatterZipCreator.java:175)
      1 frame
    6. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      4. java.lang.Thread.run(Thread.java:745)
      4 frames