现在的位置: 首页 > 综合 > 正文

How to import Gradle project into eclipse

2018年01月09日 ⁄ 综合 ⁄ 共 3416字 ⁄ 字号 评论关闭

How to Integrate Eclipse with Gradle project?
1.download groovy eclipse plugin ---3.7 (Indigo)

http://dist.springsource.org/release/GRECLIPSE/e3.7/

2.download gradle eclipse plugin ---http://dist.springsource.com/release/TOOLS/gradle

refer to following document:

Gradle STS Support -- 2.9.0 -- Installation

Note: The latest version of this file can always be found here

You can install the Gradle STS support in one of two ways. The easiest way to install is from the STS Dashboard extensions page. Simply search for "Gradle" to find the extension, select it and install.
Optionally (if you want editor support) you should also install the "Groovy Eclipse" extension in the same way.
Requirements:

Either one of the following:
An instance of STS 2.7.M1 or later based on Eclipse 3.6.2 or Eclipse 3.7.
An instance of Eclipse 3.6.2 or later. (The required components of STS will be pulled in during the installation process).
Optionally (if you want support for editing .gradle files) a compatible Groovy Eclipse installation is required (STS 2.9.0.M2 requires Groovy Eclipse 2.6.1. The Gradle tooling should be usable without Groovy Eclipse, but some functionality (related to editing
gradle files) will not work.

Installation instructions:

Installing from the STS dashboard
The easiest way to install is from the STS Dashboard "Extensions" page. 
First download and install a recent release of STS (2.9.0 release or later recommended).
Open STS and in the dashboard click on the "Extensions" tab.
Search for "Gradle" or "Groovy" depending on you are installing, select it and click "Install".
Review the list of software that will be installed and click "Next".
Review and accept licence agreements and click "Finish".
Installing Gradle Tooling from update site

Alternatively you can install from update sites. The following update sites are available:
http://dist.springsource.com/snapshot/TOOLS/nightly/gradle (latest development snapshot)
http://dist.springsource.com/milestone/TOOLS/gradle (latest milestone build.)
http://dist.springsource.com/release/TOOLS/gradle (latest release)
Note: pasting the above URLs into a web browser will not work. You need to follow the instructions given below to use an Eclipse update site.

If you are installing into STS one of these update sites will be sufficient. 

If you are installing in a plain Eclipse, you will also need to add additional update sites to satisfy some dependencies. The easiest way is to download one of the following bookmarks files and save it to your hard drive then import the bookmarks:

For eclipse 3.7:

http://dist.springsource.com/release/TOOLS/composite/e3.7/bookmarks.xml

http://dist.springsource.com/milestone/TOOLS/composite/e3.7/bookmarks.xml

http://dist.springsource.com/snapshot/TOOLS/composite/e3.7/bookmarks.xml

For eclipse 3.6: 

http://dist.springsource.com/release/TOOLS/composite/e3.6/bookmarks.xml

http://dist.springsource.com/milestone/TOOLS/composite/e3.6/bookmarks.xml

http://dist.springsource.com/snapshot/TOOLS/composite/e3.6/bookmarks.xml

Detailed instructions: (steps 2..4 can be skipped if you are installing into STS).
Open "Help >> Install New Software"
Click "Available Software sites".
Click the "Import" button.
Find the saved "bookmarks.xml" file and click "OK".
Paste the Gradle update site link into the "Work with" text box
Select both available features (Gradle Tooling API and SpringSource Tool Suite Gradle Integration).
Click "Next"
Review the list of software that will be installed. Click "Next" again.

Review and accept licence agreement and Click "Finish".

Installing Groovy Eclipse from Update Site
To install Groovy Eclipse from update site see here.

How to import gradle project into eclipse:
1.import gradle project
2. select the folder
3.Click "build model"
4. import successfully.

Issue:
Cannot find System Java Compiler. Ensure that you have installed a JDK

--Solution: set Java_home in preference-->gradle-->Java_home

抱歉!评论已关闭.