Create and run a new Maven web project in Eclipse

Vinod Kumar Kayartaya
A free video tutorial from Vinod Kumar Kayartaya
Evangelist, Consultant and Developer.
4.5 instructor rating • 15 courses • 25,585 students

Learn more from the full course

Develop RESTful Java Web Services using JAX-RS and Jersey

Everything you need to know for developing your RESTful web service.

02:10:09 of on-demand video • Updated June 2020

  • Setup a Java development environment using Java 8, Eclipse & Tomcat 9 on your computer
  • Create a new maven project & add the necessary library dependencies for creating your first JAX-RS web service
  • Code your web services to respond with different MIME types
  • Handle errors
  • Create web services that support CRUD operations
  • Test your Java web services with the Postman Chrome extension
  • Build and deploy web services
English [Auto] The next step is for us to create a new MAVEN project to do so. You go to find new and MAVEN project. Once again all these many options will change. If you in a different perspective. For example if I go to Java perspective and if I say fine new you will see that that is a dollar project and there are few other options. But no me one project and to quickly switch within perspective we can also select these buttons since I already selected Johnny Hadley. So that is listed over here. I can click on this button and the perspective will change. Now I have your file new May 1 budget. Another option is I can click on this button and say MAVEN project. I can also see here right click and send you and then I'm allowed to select your other mainland project. So I go to New MAVEN project in the first step. We click on this create a simple project to skip any archetype selection next May when projects are out of the nest in terms of folders and the folders are again grouped into group idea an artifact dating group age and the leader presents your organization an artifact or a template a potential project and group being the company name usually it will be the website in reverse. So I can type called out the for my Web site. We no doubt call artifact dirty. I can take a jack slot as attached training I can leave the list in to be whatever that it is currently packaging I have to choose one since we are going to work with web applications the rest of the fields here are optional. You can click the finished button to come out of this dialog box as you can see that your project currently shows an error and you can find out what are the errors in the markers section here and it is that May 1 Java EE configuration problem. If it's fun it will show that that dot symbol is missing. So as far as Java is concerned that dot symbol is a mandatory flight since May has not either that flight. We have to manually. No. One of the other reasons why this error message is coming is because currently the java version of this is pointing to one dot fight. So if you go to right click and then go to build a bot configured to build a bot you will see that it has chosen Java. It's the one dot fight. I have to select Java C 8 so I can choose that from the finish. I say applying and then also come to the compiler just to verify if it has taken effect. One more section here is project sets and the project for it says Java is one looks like as you can see here we have an option to change the same. I'll take this to Windows 8 I'd say applying and now if I see a plan close the java version has been taken care of but not similar still missing. The next thing that you can do is to add the better example to do so right click the project Joy tools and they have an option on generate deployment descriptor stop. And this adds to the DOT example under a SC main set that rabbi in a folder so you can see that there is a robotic symbol. No we will be adding an entry here so that our JAGs audit's application works properly. Just to check if this application is properly configured we can add another HDMI five new age to Yemen and call this US index HDMI. And that goes into the web apps for the mean is the form says a bit and I can change the title of saying checks Ortiz demo. I'll add a one this is a homepage for Jack's August demo application. Save it. And now you can right click the project and say run as an announcer. And this opens the dialog box to choose different set of words. Since I have only one server I can always use this or when running this project I can click on this and say next. And it is. Do you have any other projects would you like to add to Tomcat or do you want to remove anything from docket. We don't have to do anything here click the finished button. So as you can see the local host a 0 0 slash Jack's artist training that's our domain name no. And the home page has come up which means our project is properly setup.