Create web application using gradle in eclipse

The following two tabs change content below.
Prasad Kharkar is a java enthusiast and always keen to explore and learn java technologies. He is SCJP,OCPWCD, OCEJPAD and aspires to be java architect.

Latest posts by Prasad Kharkar (see all)

We have seen how we can create gradle web app. Here, we will use eclipse plugin for the same.

Create Web Application Using Gradle In Eclipse:

Please refer how to create gradle project in eclipse . After you follow mentioned steps, you should be able to see project structure created. In this article we will learn how to use Gradle Tasks tab in eclipse. As of now you must be able to see the project view. as below.

GradleProjectCreated

If you check bottom of eclipse, you should be able to view a tab named Gradle Tasks

2016-06-01 14_17_29-Java EE - GradleEclipseProject_build.gradle - Eclipse

Here you will see all available operations that you can perform on GradleEclipseProject.

For this example, we will simply create a war file for GradleEclipseProject. We need to apply the war plugin. Our build.gradle file to create a web application using gradle in eclipse is very simple as below .

thats it. We will create web application using gradle in eclipse using gradle tools.

Navigate to Gradle Tasks bar > Expand GradleEclipseProject> Expand build > Right click on build > Run Gradle Tasks. 

select build option

Check Gradle Executions tab, you should see a list of tasks executed.

Gradle Executions

 

All green dots means all operations are successful. You can check console tab for output.

Working Directory: D:\workspaces\JUnitWS\GradleEclipseProject
Gradle User Home: C:\Users\469622\.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 2.13
Java Home: C:\Program Files\Java\jdk1.8.0_92
JVM Arguments: None
Program Arguments: None
Gradle Tasks: <run default tasks>

:help

Welcome to Gradle 2.13.

To run a build, run gradle <task> …

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle –help

To see more detail about a task, run gradle help –task <task>

BUILD SUCCESSFUL

Total time: 0.379 secs

I hope this article helped understand how to create web application using gradle in eclipse.

Share Button

Prasad Kharkar

Prasad Kharkar is a java enthusiast and always keen to explore and learn java technologies. He is SCJP,OCPWCD, OCEJPAD and aspires to be java architect.

Leave a Reply

Your email address will not be published. Required fields are marked *