Error Jenkins Maven Build 137

+1 vote
I’ve created a Maven project that builds different Maven projects on Jenkins. The problem is that every time I build the project, I get the following error:

ERROR: Maven JVM terminated unexpectedly with exit code 137
Aug 8, 2018 in Jenkins by Tyrion anex
• 8,660 points

recategorized Nov 12, 2018 by Omkar 4,190 views
Does it work when you run these maven projects from the console instead of Jenkins?
Yes it works fine when I build it through the console. It just doesn't build when I build it from Jenkins.

7 answers to this question.

0 votes

Try increasing the values of the memory settings - in MAVEN_OPTS on Jenkins, e.g.

MAVEN_OPTS=-Xmx1.5G -XX:MaxPermSize=0.7G 

 This might help.

answered Aug 8, 2018 by Sophie may
• 10,550 points
0 votes

This is mostly a memory issue. Try restarting your Jenkins. Worked for me. Could use this temporary solution. If anybody has an explanation and a better solution for this error, please do let me know.

answered May 5, 2019 by Kanika
0 votes
This is definitely a memory issue. Reason - Few resources are not being freed up.

Right now I am following@Kanika's solution of restarting Jenkins(worked like a charm) but I'm sure there is a better solution to this.  

Still looking for a proper solution.
answered May 5, 2019 by Nishant
0 votes
As @Nishant mentioned, it a memory issue. Increase the maven memory and try if it works.
answered May 5, 2019 by Pam
+1 vote
I disagree with @Pam's answer. The problem is not with maven memory. The problem is with Virtual Machine memory. Increase the memory allocated to your VM. This did the trick for me!
answered May 5, 2019 by Danica
0 votes

I increased the memory using Global MAVEN_OPTS:

-Xmx4096m -Xms4096m

and it worked for me

answered May 5, 2019 by Yogesh
0 votes
I added a maven_opts parameter for garbage collection:


After that, the memory gets freed up better and faster.
It made my build absolutely stable
answered Feb 28, 2020 by tigu

Related Questions In Jenkins

0 votes
1 answer

Getting below error on Jenkins while creating a Maven Build Job

When you are using ssh to connect, ...READ MORE

answered Sep 3, 2019 in Jenkins by Hari
+1 vote
1 answer

Error: Maven runs with the wrong JDK on Jenkins

Perform the following steps: 1) Navigate to Manage ...READ MORE

answered Aug 8, 2018 in Jenkins by Sophie may
• 10,550 points
0 votes
1 answer

Jenkins - maven project fails at Build stage

To fix this, you need to change ...READ MORE

answered Aug 10, 2018 in Jenkins by Sophie may
• 10,550 points
0 votes
1 answer

Error saying "localhost:3001error" When trying to run a build - Jenkins

There are two possible issues with this ...READ MORE

answered Dec 19, 2018 in Jenkins by Kalgi
• 52,350 points
+1 vote
2 answers

I'm unable to build my code in Jenkins. Getting the error shown below.

Hi, @Ashutosh, Do you have a pom.xml in ...READ MORE

answered Aug 3, 2020 in Jenkins by Gitika
• 65,910 points
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer