Setup first gradle project in eclipse

UPDATED: 01 January 2017

Gradle (Modern Open Source Build Tool for Continuous Delivery)
Built over the concepts of Apache Ant and Apache Maven. It helps you with build process of project. Using Gradle you can perform tasks like

  • Build project and its sub projects.
  • Test the build.
  • Execute customized task like you do with any other programming language using.
Gradle uses Groovy Programming language for project configuration.

Step 1. Download Gradle
Download latest binary distribution from https://www.gradle.org/gradle-download/

Step 2. Extract the binary.
Extract the downloaded binary in say C:\gradle-3.2.1.

Step 3. Setup Gradle eclipse preference.
In Eclipse go to Window > Preferences > Gradle (STS) > Folder.


Step 4. Download eclipse gradle plugin.
In Eclipse go to Help > Eclipse Marketplace and search for gradle. There is official eclipse plugin from gradle however I prefer the gradle plugin developed by Spring as a part of Sprint Tool Suits (STS).


Step 5. Create new Gradle project.
Go to File > New > Other > Gradle (STS) > Gradle (STS) Project.


Step 6. Specify your first gradle project name.


Step 7. Upgrade Java version
Sample gradle project is configured to use Java 1.5 so change it to your system's Java version. Open build.gradle and change sourceCompatibility = 1.5 to sourceCompatibility = 1.8

Step 8. Refresh gradle project.

Right click on Project and go to Gradle (STS) > Refresh All.



0 comments :