[英]Use global gradle install with Buildship
I want to create a Gradle project in Eclipse using Buildship. 我想使用Buildship在Eclipse中创建Gradle项目。 When I create it, the IDE tries to download Gradle 2.9 from somewhere.
创建它时,IDE尝试从某个地方下载Gradle 2.9。
But I have a system-wide install of Gradle 2.12 (installed by pacman). 但是我在系统范围内安装了Gradle 2.12(由pacman安装)。
How can I convince Buildship to use my local Gradle installation? 如何说服Buildship使用本地Gradle安装?
I prematurely clicked finish. 我过早地单击完成。 One should click next and specify (in my case)
一个应该单击下一步并指定(以我为例)
/usr/share/java/gradle
as the local installation directory. 作为本地安装目录。
Add inside build.gradle this: 在build.gradle中添加以下内容:
task wrapper(type: Wrapper) {
gradleVersion = '2.12'
}
Or run the wrapper task with the argument -gradle-version 2.12 (to add this right click on the wrapper task, in the Gradle Tasks view of Eclipse. 或使用-gradle-version 2.12参数运行wrapper任务(要在Eclipse的Gradle Tasks视图中右键单击wrapper任务,请添加该右键单击。
Finally run the following tasks: clean, wrapper, build. 最后,运行以下任务:清理,包装,构建。 Ensure that inside the project root directory, the ./gradle/wrapper/gradle-wrapper.properties file contains the following line:
确保在项目根目录中,。/ gradle / wrapper / gradle-wrapper.properties文件包含以下行:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip
Otherwise substitute/insert it and rerun gradle clean, wrapper, build. 否则,替换/插入它并重新运行gradle clean,wrapper,build。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.