Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61246

withMaven is not picking mavenOpts: '-Xmx2048m'


      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] {

            aheritier Arnaud Héritier
            boby8064 Sadguru Chikkam
            0 Vote for this issue
            4 Start watching this issue