如何更改IntelliJ IDEA中'默认gradle包装器'的版本? [英] How to change the version of the 'default gradle wrapper' in IntelliJ IDEA?
问题描述
我想使用Gradle 1.10 而不是 1.9。我似乎无法找到要更改的位置。
I want to use Gradle 1.10 instead of 1.9. I cannot seem to find where to change this.
如果我把这个:
If I put this:
task wrapper(type: Wrapper) {
gradleVersion = '1.10'
}
在我的 build.gradle
并重建,它再次用Gradle 1.9 构建(所以没有实际发生)。
in my build.gradle
and rebuild, it is built with Gradle 1.9 again (so nothing actually happens).
这些似乎是所有设置:(和IntelliJ's 关于Gradle的帮助部分根本没有帮助:()
These seem to be all the settings: (and IntelliJ's help section about Gradle doesn't help at all :( )
推荐答案
最简单的方法是从命令行执行以下命令(请参阅升级Gradle Wrap ):
The easiest way is to execute the following command from the command line (see Upgrading the Gradle Wrapper in documentation):
./gradlew wrapper --gradle-version 2.12
或者你可以创建一个自定义的 wrapper
任务
Or you can create a custom wrapper
task
task wrapper(type: Wrapper) {
gradleVersion = '2.12'
}
并运行 ./ gradlew wrapper
。
这篇关于如何更改IntelliJ IDEA中'默认gradle包装器'的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!