This article will explain how to create gradle project in eclipse. As we’ve seen previously, gradle is a build tool which provide certain advantages over other build tools. We will further look into it and try to understand it better.
Create Gradle Project In Eclipse
I am using following to create gradle project in eclipse.
Installing Buildship plugin for gradle:
First, Open a blank eclipse workspace.
First of all, we will have to download plugins for integrating gradle with eclipse. Navigate to Help > Eclipse Marketplace. When dialog box opens, search for Buildship and you should be able to view available Buildship plugin for gradle
After it is installed successfully, eclipse will ask for restart. Click OK.
Create Gradle Project In Eclipse:
Click File > New > Other. You will see a window opened where you can select the type of project you want to create. Here we will create gradle project in eclipse as shown below.Select Gradle Project as shown and click Next >
You will go to a new dialog box which will ask you to specify name for it. Enter some name and click Finish.
After pressing Finish, you will see project structure created as below.
Note that this is a project structure defined for a gradle project.
- src/main/java folder will contain all java source files
- src/test/java folder will contain all java test cases
- build.gradle file will have build script for project
- settings.gradle file will contain necessary settings.
In further tutorials, we will see how we can create web applications just like this article explains how to create gradle project in eclipse