如何指定Gradle包装器下载位置? [英] How can a specify the Gradle wrapper download location?
问题描述
我通过查看控制台输出结果确认每次构建都会下载gradle:
11:24:42正在下载http://services.gradle.org/distributions/gradle-1.5-bin.zip
11:24:48 .................................................. ......
11:24:49解压缩/home/workspace/our_build/wrapper/dists/gradle-1.5-bin/9si5v6u7tk37kj5dlsrdcm595/gradle-1.5-bin.zip
到/ home / workspace / our_build / wrapper / dists / gradle-1.5-bin / 9si5v6u7tk37kj5dlsrdcm595
我认为原因是因为accurev插件将永远清除每次运行的整个工作区(无法禁用)。
是否可以配置gradle下载位置?
所有工作使用共享位置安全吗?或者每个工作都有一个位置更好?
distributionUrl
)。您也可以保持原样,但指定包装器必须存储的位置( distributionBase
),这将允许将其存储在每次清理的目录之外您的accurev插件。 我不明白为什么使用共享位置不安全。这是默认情况下完成的,因为包装存储在gradle用户主目录中。
We moved our project to gradle and we have continuous build on Jenkins. We use the gradle wrapper and the Jenkings gradle plugin.
I recognized by reviewing the console output that gradle will be downloaded on each build:
11:24:42 Downloading http://services.gradle.org/distributions/gradle-1.5-bin.zip
11:24:48 ........................................................
11:24:49 Unzipping /home/workspace/our_build/wrapper/dists/gradle-1.5-bin/9si5v6u7tk37kj5dlsrdcm595/gradle-1.5-bin.zip
to /home/workspace/our_build/wrapper/dists/gradle-1.5-bin/9si5v6u7tk37kj5dlsrdcm595
I think the reason is because the accurev plugin will purge always the whole workspace for each run (cannot be disabled).
Is it possible to configure the gradle download location? Is it safe to use a shared location for all jobs? Or is it better to have a location per job?
The Wrapper task has several properties allowing its customization. You can specify an alternate URL to download it (distributionUrl
). You can also leave the URL as is, but specify where the wrapper must be stored (distributionBase
), which would allows storing it outside of the directory which is cleaned up every time by your accurev plugin.
I don't see why it wouldn't be safe to use a shared location. This is what is done by default, since the wrapper is stored in the gradle user home directory.
这篇关于如何指定Gradle包装器下载位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!