在将项目集成到 Jenkins 后,经常会出现不稳定的构建,Jenkins 控制台输出的错误信息为:Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

经过调查,问题可能出在 ./gradlew assembleDebug 这条命令上。

通过查看Gradle的官方文档,得知从 Gradle 3.0 开始,Daemon 便默认开启的。它是一个长时间运行的后台进程,作用是在内存中存储构建信息,以便在之后的构建过程中复用信息提高构建速度。

但是在文档中,也提到一句:If you run CI builds in ephemeral environments (such as containers) that do not reuse any processes, use of the Daemon will slightly decrease performance (due to caching additional information) for no benefit, and may be disabled. 大概的意思是如果通过CI(持续集成)进行项目构建,Daemon 就没多大作用了,反倒会因为存储额外的信息而降低系统性能,从而导致被停用。

那么,如何在 Jenkins 里停止使用 Daemon 呢?

很简单,如下:
./gradlew --no-daemon assembleDebug
在命令里加入一个 --no-daemon 参数就好啦。

Jenkins报错'Gradle build daemon disappeared unexpectedly'的问题解决的更多相关文章

  1. linux服务器使用Jenkins+gradle+git打apk包,报错Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

    linux服务器使用Jenkins+gradle+git打apk包,遇到的错误Gradle build daemon disappeared unexpectedly (it may have bee ...

  2. Jenkins 报错合集

    目录 一.启动项目显示,没有接受许可之前不能够自动安装 二.明明配置了jdk但还是说找不到 三.jenkins-RestAPI调用出现Error 403 No valid crumb was incl ...

  3. 在spring添加注解时,第一行package报错configure build path

    练习spring的ioc的注解的时候写上注解就会在第一行package报错configure build path. 用的spring4.2.4的jar包.经过上网查阅资料,可能是jar包冲突,解决办 ...

  4. 【Mac + Appium】之运行报错:[UiAutomator] UiAutomator exited unexpectedly with code 0, signal null

    产生下面的原因是因为:与uiautomator2的weditor冲突,两者不能同时使用. 有时打开appium时会报错: [UiAutomator] UiAutomator exited unexpe ...

  5. jenkins报错;自定义工作目录;

    [1]no such file 报错: 如果jdk配置路径错误,有可能会报这样的错误: 其实只要在/etc/profile中配置好JAVA_HOME就足够了: 对应的系统配置框,留空不新加即可: [2 ...

  6. Jenkins报错Caused: java.io.IOException: Cannot run program "sh" (in directory "D:\Jenkins\Jenkins_home\workspace\jmeter_test"): CreateProcess error=2, 系统找不到指定的文件。

    想在本地执行我的python文件,我本地搭建了一个Jenkins,使用了execute shell来运行我的脚本,发现报错 [jmeter_test] $ sh -xe D:\tomcat\apach ...

  7. jenkins报错The goal you specified requires a project to execute but there is no POM inthis directory

    报错截图及详细:   15:30:29[ERROR]The goal you specified requires a project to execute but there is no POM i ...

  8. vs code调试console程序报错--preLaunchTask“build”

    网上有其他大神给出的建议是注释掉launch.json中的 "preLaunchTask": "build", 但是这种方式也会造成一个问题,就是再使用F5调试 ...

  9. 解决 docker 报错: Error starting daemon: error initializing graphdriver: backing file system is unsupported for this graph driver

    CentOS 7.5 x64下 sudo yum install docker -y systemctl enable docker systemctl start docker 发现启动失败 jou ...

随机推荐

  1. Appium移动自动化测试入门及简单实例(python)

    1.介绍 Appium是一个移动端的自动化框架,可用于测试原生应用.移动网页应用和混合型应用,且是跨平台的.可用于IOS和Android以及firefox的操作系统.原生的应用是指用android或i ...

  2. 【微服务】.netCore eShopOnContainers 部署实践《一》

    官方说明文档 -------------------------------------------------------------- # eShopOnContainers - Microser ...

  3. cc、gcc、g++、CC的区别和联系

    gcc是C编译器:g++是C++编译器:linux下cc一般是一个符号连接,指向gcc:gcc和g++都是GUN(组织)的编译器.而CC则一般是makefile里面的一个名字,即宏定义,嘿,因为Lin ...

  4. Tools - 使用Doxygen和Graphviz分析代码

    简介 使用Doxygen来生成结构,使用Graphviz来显示结构: Doxygen:http://www.doxygen.nl/ 用来生成项目文档的工具软件,可将程序中的特定批注转换成为说明文件,还 ...

  5. Spring Cloud Finchley 正式发布,包含 4 个重大更新!

    在 Spring 的官方博客上已经看到 Spring Cloud Finchley 在 06 月 19 日这一天正式发布了,我们在 Maven 中央仓库也看到了最新版的更新. Finchley 正式版 ...

  6. 从零开始学 Web 之 Ajax(四)接口文档,验证用户名唯一性案例

    大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...

  7. 死锁排查的小窍门 --使用jdk自带管理工具jstack

    本文版权归 远方的风lyh和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 开发时间久了,难免会写出一些一些死锁的代码,自己明明调用该方法可该方法就是不执行.不进该方法.日志也不打 ...

  8. Spring Cloud Consul使用——配置中心

    1.pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www ...

  9. jfinal定时任务插件jfinal-quartz

    这个定时任务插件精确的时间可以到秒,使用方面跟jfinal-scheduler插件的使用方式差不多 Dreampie/jfinal-quartz https://github.com/Dreampie ...

  10. idea集成uglifyjs2

    项目中可能会多次修改某些*.js文件,但是引用的是*.min.js, 所以需要再改完源码后生成压缩的min.js uglifyjs是个不错的工具,但是单独用略显麻烦,如果能整合到idea就好了.正好i ...