title: JenkinsX - Build fail due to Java Heap space
body: <p>I am working on creating CI/CD pipeline for Spring Boot application on GKE using JenkinsX. As soon as I push the code to the master branch, build gets triggered but the build fails due to insufficient Java heap space.</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.2.2:war (default-war) on project location-finder-api: Error assembling WAR: Problem creating war: Execution exception: Java heap space -&gt; [Help 1]
  
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.2.2:war (default-war) on project location-finder-api: Error assembling WAR: Problem creating war: Execution exception
  </code></pre>
  
  <pre><code>Caused by: java.lang.OutOfMemoryError: Java heap space
  
      at org.codehaus.plexus.archiver.zip.ByteArrayOutputStream.needNewBuffer (ByteArrayOutputStream.java:153)
  
      at org.codehaus.plexus.archiver.zip.ByteArrayOutputStream.write (ByteArrayOutputStream.java:192)
  
  </code></pre>
  
  <p>To resolve I tried to set the JVM argument in the Docekrfile as</p>
  
  <pre><code>CMD ["java", "-Xmx1024m","-jar", "app.jar"]
  </code></pre>
  
  <p>But it did not work. This is what I see when the build starts</p>
  
  <pre><code>+ mvn -e clean deploy -Pprod
  
  Picked up _JAVA_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true -XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Xms10m -Xmx192m
  
  OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
  </code></pre>
  
  <p>Is there any way that I can set this heap option on my own?</p>