Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins build failure,Gradle build daemon disappeared unexpectedly

My CI Server configuration is low.

If I use the gradle daemon to build project,It throw a error:

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

Then, If I use the gradle-2.14.1 that default close gradle daemon,my task 'publish' is BUILD SUCCESS, but it will append other task to close daemon that BUILD FAILURE.

The message received from the daemon indicates that the daemon has disappeared
FAILURE: Build failed with an exception.

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

Of course,if I run the gradle at my macbookpro, everything is OK.

I found the other way to solve the problem, run gradle --stop, then run gradle <task>. But it just work for simple task.

So, how to solve this problem?

like image 732
cs x Avatar asked Dec 16 '16 14:12

cs x


People also ask

Can Gradle daemons be used with Jenkins?

Gradle Daemon on Jenkins Gradle Daemons on CI Servers In one of my current projects we’re migrating an existing monolith towards microservices. Of course our build is based on the excellent Gradle build tool. As this implies separate Jenkins pipelines for all our services, we wanted to have the Gradle daemonactivated.

What went wrong with Gradle build daemon?

* What went wrong: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed) Then, If I use the gradle-2.14.1 that default close gradle daemon,my task 'publish' is BUILD SUCCESS, but it will append other task to close daemon that BUILD FAILURE.

How do I create a build step in Gradle?

Furthermore, create a "Build step" in the section "Build" by selecting "Invoke Gradle build script". As mentioned before, we’ll want to use the Wrapper to execute the build. In the "Tasks" input box enter the build and use the "Switches" --scan -s to generate a build scan and render a stack trace in case of a build failure.

Should you run Gradle on CI servers?

Running the Gradle daemon on CI servers makes sense in most cases as your build gains performance. In addition, incremental builds are especially interesting with microservice architectures where there is a need to build many different modules (or even the root project including it’s submodules) quite often (e.g. on every commit).


1 Answers

It is recommended to turn off gradle daemon on any CI server.

use this option to disable it

--no-daemon

https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:stopping_an_existing_daemon

like image 130
RahulMohan Kolakandy Avatar answered Sep 17 '22 14:09

RahulMohan Kolakandy