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.
If you check bottom of eclipse, you should be able to view a tab named Gradle Tasks
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 .
apply plugin: 'war'
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.
Check Gradle Executions tab, you should see a list of tasks executed.
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>
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>
Total time: 0.379 secs
I hope this article helped understand how to create web application using gradle in eclipse.