Jenkins Gradle集成:调用Gradle与使用Gradle Wrapper选项 [英] Jenkins Gradle Integration: Invoke Gradle vs. Use Gradle Wrapper options
问题描述
I've just started to use Jenkins for CI with Gradle build tool for my project.
.net / SpringCentral / cd-pipeline-gradlejenkinsrel =noreferrer>使用Gradle和Jenkins构建持续交付管道,我不明白为什么作者建议总是使用Wrapper! (c)否。 120张幻灯片。为什么这比直接涉及Gradle更好?
I found Building a Continuous Delivery pipeline with Gradle and Jenkins and I do not understand reasons why the author advices to "Always use the Wrapper!" (c) on no. 120 slide. Why this is better than directly involving Gradle?
推荐答案
如果使用Gradle包装器,更容易支持不同版本的Gradle和使人们更容易从你的项目开始。他们可以克隆你的项目,运行'gradlew'并获得正确版本的Gradle。
If you use the Gradle wrapper, it's easier to support different versions of Gradle and makes it easier for someone to start out with your project. They can clone your project, run 'gradlew' and get the correct version of Gradle installed.
如果你的组织想要添加自定义配置(例如init Gradle脚本),你也可以通过Gradle包装器控制它。
If your organization wants to add custom configuration (e.g., init Gradle scripts), you can also control that through the Gradle wrapper.
如果你不使用包装器,你必须确保你的Jenkins服务器设置了正确的Gradle分布。这不是不可能的,但它将你的构建与特定的构建环境联系在一起。
If you don't use the wrapper, you have to make sure your Jenkins server is setup with the correct distribution of Gradle. That's not impossible, but it ties your builds to a particular build environment.
这篇关于Jenkins Gradle集成:调用Gradle与使用Gradle Wrapper选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!