Module 1: Setup a Development Environment - dineshmadhup/RESTful-Web-Service GitHub Wiki

Maven Project Setup for REST

Step by Step instructions:

Step:1

Open your pre-installed Eclipse IDE then go to top window and select FILE => NEW => PROJECT.

![](http://www.softarica.com/wp-content/uploads/2016/12/REST-PRODUCT-1.png)

Step:2

In select wizard window find Maven then select "Maven Project" followed by Next button.

rest-product-2

Step:3

In this step, make sure you choose the project location where you would like to save your project for future use. I am choosing default location.

![](http://www.softarica.com/wp-content/uploads/2016/12/REST-PRODUCT-3.png)

Step:4

We are building web service using JAX-RS and Jersey. So in filter section, type jersey, you should able to see "jersey-quickstart-webapp" as an Artifact Id as shown below:

![](http://www.softarica.com/wp-content/uploads/2016/12/REST-PRODUCT-4.png)

If you don't see as advised in step-4, then you need to add one. Go ahead and press "Add Archtype" button and fill the form as shown in below diagram and press OK. You can find and choose latest version of archetype. At this moment 2.16 is latest one.

![](http://www.softarica.com/wp-content/uploads/2016/12/REST-PRODUCT-5.png)

Step:5

In this step give the name of Group Id, Artifact Id and Package of your choice and click "Finish" button. Thats it. Your new web service ready now to use and customize. Yayyyyyy...

![](http://www.softarica.com/wp-content/uploads/2016/12/REST-PRODUCT-6.png)

Running REST Web Service with Java using JAX-RS and Jersey

Right click on your newly created project and select Run As => Run on Server.

Make sure you have previously configured any application server. I am using Tomcat for this project. ![](http://www.softarica.com/wp-content/uploads/2016/12/REST-PRODUCT-7.png)

Select your existing Server

Select any existing Server.

![](http://www.softarica.com/wp-content/uploads/2016/12/REST-PRODUCT-8.png)

Result:

You will see the output like this.

![](http://www.softarica.com/wp-content/uploads/2016/12/REST-PRODUCT-9.png)
⚠️ **GitHub.com Fallback** ⚠️