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

withMaven is not picking mavenOpts: '-Xmx2048m'

    Details

    • Similar Issues:

      Description

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

        Attachments

          Activity

          Hide
          boby8064 Sadguru Chikkam added a comment -

          mavenOpts: '-Xmx2048m' is not being passed through withMaven

          Show
          boby8064 Sadguru Chikkam added a comment - mavenOpts: '-Xmx2048m' is not being passed through withMaven

            People

            • Assignee:
              alobato Alvaro Lobato
              Reporter:
              boby8064 Sadguru Chikkam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: