将现有的 Gradle Git 项目导入 Eclipse
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10722773/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Import existing Gradle Git project into Eclipse
提问by Vyacheslav
I've installed eclipse gradle plugin from here
我已经从这里安装了 eclipse gradle 插件
http://kaczanowscy.pl/tomek/2010-03/gradle-ide-integration-eclipse-plugin
http://kaczanowscy.pl/tomek/2010-03/gradle-ide-integration-eclipse-plugin
Is there a simple way to import into eclipse gradle project using gui, not doing stuff
有没有一种简单的方法可以使用 gui 导入 eclipse gradle 项目,而不是做任何事情
described here: http://gradle.org/docs/current/userguide/eclipse_plugin.html
此处描述:http: //gradle.org/docs/current/userguide/eclipse_plugin.html
?
?
采纳答案by rodion
Usually it is a simple as adding apply plugin: "eclipse"
in your build.gradle
and running
通常它是一个简单的添加apply plugin: "eclipse"
在你build.gradle
运行
cd myProject/
gradle eclipse
and then refreshing your Eclipse project.
然后刷新您的 Eclipse 项目。
Occasionally you'll need to adjust build.gradle
to generate Eclipse settings in some very specific way.
有时,您需要进行调整build.gradle
,以某种非常具体的方式生成 Eclipse 设置。
There is gradle support for Eclipseif you are using STS, but I'm not sure how good it is.
如果您使用 STS,则Eclipse有gradle 支持,但我不确定它有多好。
The only IDE I know that has decent native support for gradle is IntelliJ IDEA. It can do full import of gradle projects from GUI. There is a free Community Edition that you can try.
我所知道的唯一一个对 gradle 有良好原生支持的 IDE 是IntelliJ IDEA。它可以从 GUI 完全导入 gradle 项目。您可以试用免费的社区版。
回答by Hammad Hassan
There is a simplest and quick way to import a Gradle project into Eclipse.
Just download the Gradle pluginfor Eclipse from here.
https://marketplace.eclipse.org/content/gradle-integration-eclipse-0
有一种最简单快捷的方法可以将 Gradle 项目导入 Eclipse。只需从这里下载Eclipse的Gradle 插件。
https://marketplace.eclipse.org/content/gradle-integration-eclipse-0
And then from import select Gradle and your project would be imported. Then you have to click on Build Modelto run it.
然后从导入选择 Gradle,您的项目将被导入。然后你必须点击构建模型来运行它。
EDIT
Above link for Gradle pluginis no more valid. You can use the link as mentioned in the comment by @vikramvi
编辑
上面的Gradle 插件链接不再有效。您可以使用@vikramvi 评论中提到的链接
https://marketplace.eclipse.org/content/buildship-gradle-integration
https://marketplace.eclipse.org/content/buildship-gradle-integration
回答by Rajkumar Singh
Add the following to your build.gradle
将以下内容添加到您的 build.gradle
apply plugin: 'eclipse'
and browse to the project directory
并浏览到项目目录
gradle eclipse
回答by Vibhor Bhardwaj
I have gone through this question earlier but did not found complete gui based solution.Today I got a GUI based solution provided by spring.
我之前已经解决了这个问题,但没有找到完整的基于 gui 的解决方案。今天我得到了一个由 spring 提供的基于 GUI 的解决方案。
In short we need to do only that much:
简而言之,我们只需要做这么多:
1.Install plugin in eclipse from update site: site link
1.从更新站点在eclipse中安装插件: 站点链接
2.Import project as gradle and browse the .gradle file..that's it.
2.将项目导入为gradle并浏览.gradle文件..就是这样。
Complete documentation is here
完整的文档在这里
回答by Vyacheslav
The simpliest way is to use sts gradle integration and import project
最简单的方法是使用sts gradle集成导入项目
http://static.springsource.org/sts/docs/2.7.0.M1/reference/html/gradle/gradle-sts-tutorial.html
http://static.springsource.org/sts/docs/2.7.0.M1/reference/html/gradle/gradle-sts-tutorial.html
Don't forget to click "Build Model" button.
不要忘记单击“构建模型”按钮。
回答by Malkiat Randhawa
Open eclipse and right click in the package explorer → import Select gradle Browse to the location where you checked out Click “Build Model” Select all the projects and hit finish
打开 eclipse 并在包资源管理器中右键单击 → import 选择 gradle 浏览到您检出的位置 单击“构建模型” 选择所有项目并点击完成
回答by Sheece Gardazi
Go to the GitHub page where they are maintain the official repository: https://github.com/spring-projects/eclipse-integration-gradle/blob/master/README.md
转到他们维护官方存储库的 GitHub 页面:https: //github.com/spring-projects/eclipse-integration-gradle/blob/master/README.md
Copy the latest release link: http://dist.springsource.com/release/TOOLS/gradle(latest release)
复制最新发布链接:http: //dist.springsource.com/release/TOOLS/gradle(最新发布)
Use this in Eclipse->Help->Install New Software..->Paste the link in "Work With"->press enter->select the names of the extension->click next and agree the license and follow the prompts.
在 Eclipse 中使用它-> 帮助-> 安装新软件..-> 在“使用”中粘贴链接-> 按 Enter-> 选择扩展名-> 单击下一步并同意许可并按照提示进行操作。
After you have installed just import the project as a grade project and eclipse will take of the rest.
安装后,只需将项目作为成绩项目导入,Eclipse 将完成其余工作。
回答by Kabirul Islam
You can do the following steps:
您可以执行以下步骤:
Install the Builship Gradle Integration using the Eclipse Marketplace. Simply type Builship and click on search item. Now click on Install.
Click on File -> Import ? Existing Gradle Project.
Navigate to project root directory.
Click on a finish to load your project.
使用 Eclipse Marketplace 安装 Builship Gradle 集成。只需输入 Builship 并单击搜索项目。现在点击安装。
单击文件 -> 导入?现有的 Gradle 项目。
导航到项目根目录。
单击完成以加载您的项目。
Might be it will take some time for the first time to import Gradle project. So please be passion on it. Thank you.
第一次导入 Gradle 项目可能需要一些时间。所以请对它充满热情。谢谢你。
回答by shen ke
I use another Eclipse plugin to import existing gradle projects.
我使用另一个 Eclipse 插件来导入现有的 gradle 项目。
You can install the Builship Gradle Gntegration 2.0using the Eclipse Marketplace client.
您可以使用 Eclipse Marketplace 客户端安装Builship Gradle Gntegration 2.0。
Then you choose FIle ? Import ? Existing Gradle Project.
然后你选择FILE ?进口 ?现有的 Gradle 项目。
Finially, indicate your project root directory and click finish.
最后,指定您的项目根目录并单击完成。
回答by Lakhwinder Singh
Add the following to your build.gradle
将以下内容添加到您的 build.gradle
apply plugin: 'eclipse'
and browse to the project directory
并浏览到项目目录
gradle eclipse
Once done, you could import the project from eclipse as simple Java Project.
完成后,您可以将项目从 Eclipse 导入为简单的 Java 项目。