简体   繁体   English

在Buildship中使用全局Gradle安装

[英]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.

相关问题 使用Buildship在Gradle中实现项目依赖 - Gradle Project Dependencies in Eclipse with Buildship Gradle Buildship项目依赖周期误报 - Gradle Buildship project dependency cycle false positive 如何限制BuildShip(gradle eclipse)集成功能? - How to limit BuildShip (gradle eclipse) integrated functionality? 无法使用Gradle(Buildship 1.x)导入,因为未安装Buildship Gradle Tooling 1.x版本 - Can not import using Gradle (Buildship 1.x) because Buildship Gradle Tooling version 1.x is not installed Eclipse 上的 BuildShip Gradle 插件,报告“同步 gradle 项目工作区失败” - BuildShip Gradle plugin on Eclipse, reports "syncrhonize gradle project workspace failed" Spring Tool Suite(STS) - 无法使用Gradle(Buildship)导入 - Spring Tool Suite (STS) - Can not import using Gradle (Buildship) Eclipse Gradle buildship导入子项目编译错误 - Eclipse Gradle buildship import sub project compilation error Eclipse WTP + Gradle Buildship未部署所有项目依赖项 - Eclipse WTP + Gradle Buildship not deploying all project dependencies Eclipse Neon.2 中的 Spring starter 插件问题:无法添加 Gradle Buildship - Spring starter plugin issue in Eclipse Neon.2 : Unable to add Gradle Buildship 如何获得Gradle Buildship以在Eclipse中成功构建我的JAXB代码? - How do I get Gradle Buildship to build my JAXB code successfully in Eclipse?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM