简体   繁体   English

通过詹金斯,Gradle构建花费太长时间

[英]Gradle build takes too long through jenkins

My Java/Springboot project build is very slow via Jenkins with Gradle plugin. 通过带有Gradle插件的Jenkins,我的Java / Springboot项目构建非常慢。 When try checkout manually and try the below : 当尝试手动结帐并尝试以下操作时:

gradle build Gradle构建

Build runs very fast ! 构建运行非常快! around 3 minutes , otherwise will take around 29 minutes. 大约需要3分钟,否则大约需要29分钟。

The Build step i do via Jenkins is the same actually, 我通过詹金斯(Jenkins)进行的构建步骤实际上是相同的,

在此处输入图片说明

The SVN code checkout part is fast on both method. 两种方法中SVN代码检出部分都很快速。 Only the build part is slow. 仅构建部分很慢。 What could be the issue ? 可能是什么问题 ?

I think that the answer is the download time of artifacts. 我认为答案是工件的下载时间。

When you run 2 builds , does the second one run faster ? 当您运行2个版本时,第二个版本是否运行得更快? Try to remove the .gradle folder from your local machine and build. 尝试从本地计算机上删除.gradle文件夹并进行构建。 How much time it took ? 花了多少时间?

Are you using an artifact repository - artifactory / Nexus ? 您是否正在使用工件存储库-artifactory / Nexus?

You could add the --profile argument to the gradle command line to write a report to build/reports/profile . 您可以在gradle命令行中添加--profile参数,以将报告写入build/reports/profile From that you'll be able to see where all the time is being spent. 从中,您将能够看到所有时间都花在了哪里。 See profiling a build 请参阅分析构建

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM