| I am getting an error "java.lang.OutOfMemoryError: Java heap space" when i am trying to build my code. And I am trying to pass JAVA_OPTIONS as below but for some reason it is not being passed. stage('Build') { steps { script { withMaven(mavenOpts: '-Xmx2048m') { sh("mvn package -DskipTests=true") } } } } Could see in the logs as below: [withMaven] Options: [] [withMaven] Available options: [withMaven] using JDK installation provided by the build agent $ /bin/sh -c "which mvn" [withMaven] using Maven installation provided by the build agent with executable /apps/pcehr/tools/apache-maven-3.3.9/bin/mvn [Pipeline] { |