- First create a Java → Java Class Library project.
This project will be used to contain classes we expect to share between the service and the client.
- Create a second project Java Web → Web Application.
This project will serve as our REST service application.
- Add the first project to the second project.
- (Optional) Create a Java → Java Application
This final project will be used for as our client application.
- (Optional) Add the first project to the client project.
The most important part of the recommendation is to make sure that you have a separate library project. The shared code can later be used in multiple projects without refactoring later.
Here is an example project that meets the recommendations above. It was created with NetBeans 7.1 RC2.