Reference to the Http://blog.sina.com.cn/s/blog_4b20ae2e0102uz4t.html
1. On grandle website Download gradle, address:http://www.gradle.org/downloads
If just run can only download bin, in order to expand the development or download all.
2. After downloading, unzip the zip directly and put it in your computer's software installation directory, for example: D:\Program Files
3. In the computer/My Computer settings environment variables, if you download all, you need to add Gradle_home point to gradle the directory of the installation directory, for example: D:\Program files\gradle-2.0. You then need to add the bin directory of the Gradle to the PATH environment variable, for example: D:\Program files\gradle-2.0\bin
4. The above steps are set up, open cmd, run gradle-v can see Gradle version information, flag configuration is complete.
5. Open Eclipse,help-->install new software, enter Http://dist.springsource.com/release/TOOLS/gradle
If the prompt cannot find the address, it is estimated that the wall dropped, need to turn the wall. If you find the address, choose the reality to install the items, and then continue to press the next step, installed, restart Eclipse.
6. Create a Web project and create a Build.gradle file in the root directory
import org.gradle.plugins.ide.eclipse.model.facetapply plugin: ' maven ' apply plugin: ' Java ' apply plugin: ' War ' apply plugin: ' ECLIPSE-WTP ' sourcecompatibility = 1.8 // Settings JDK version webappdirname = ' webcontent ' // Settings WebApp root sourcesets.main.java.srcdir ' src ' // settings java Source directory// settings maven Library address repositories { mavencentral ( ) // Central Library maven { url ' http://localhost:8081/nexus/content/ Groups/public ' } // Custom library address}// setting dependency dependencies { providedcompile ' javax.servlet:servlet-api:2.5 ' // compile period providedruntime ' javax.servlet:jstl:1.2 ' // run-time}// settings project facetseclipse { wtp { facet { facet name: ' Jst.web ', type: facet.facettype.fixed facet name: ' Wst.jsdt.web ', type: Facet.FacetType.fixed facet name: ' Jst.java ', type: facet.facettype.fixed facet name: ' jst.web ', version: ' 2.5 ' facet name: ' Jst.java ', version: ' 1.8 ' facet name: ' Wst.jsdt.web ', version: ' 1.0 ' } }}
Back up a picture for everyone to see, afraid of unfamiliar
See, my project has a G, under normal circumstances is not, how to have it? We need to right-click the project "Configure->convert to Gradle project.", and then just wait for the OK, just like I have this icon G, because we add the dependency package right? , we also need to right-click the project "Gradle->refresh all" and the jar will be loaded
Look, it feels weird, right? So we continue to right-click the project, "gradle-> enable Depe .... Mana .... (Rely on management, the word is too long, too lazy to play) "
That would be nice to see.
7. Set the next jar to download the saved address, or the default is saved in the C drive, "Window->preferences->gradle" ( can not be set, I personally do not like on the C-drive )
Eclipse under Gradle Configuration