Creating a web service in Java
We will create a simple web service in Java using the test-driven development approach. The steps that we will follow are:
- Creating the project in Eclipse IDE
- Modifying the Gradle build file
- Coding the backend class
- Coding the web service code
Creating a new Gradle project in Eclipse IDE
We will create a Gradle project and then examine the generated project.
Start Eclipse IDE if it is not already running. If necessary, acknowledge the workspace
directory. This will be the root directory where Eclipse will create new projects and look for existing ones.
Eclipse IDE's Welcome
tab will now be displayed. As it does not offer a shortcut for creating a new Gradle-based project, we will ignore it for now. To create a Gradle project, do the following:
- From the
File
menu, move toNew
and chooseProject...
(be sure not to selectJava Project
or Gradle will not be used for building the project): - In the
New Project
wizard window, expand theGradle
option and select theGradle Project...