Use project as dependency of a web Project in Eclipse
With Eclipse you can use a source project and compile directly into a web project. Every time you change your dependency project a new Jar will be stored in your web project build path. This is very convenient if you are developing libraries for web projects.
- Create a Java Aplication Project and create a class that you will use later.
- Create a new Dynamic Web Project and create a JSP or class that will use your dependency.
- Right click on your Web Project and go to properties > Deployment Assembly > Add a new assembly directy (Choose your Dependency Project).
- Right click on your Web Project and go to properties > Java Build Path > Projects > Add (Choose your Dependency Project).
- Right click on your Web Project and go to properties >Project References (Make sure your Dependency Project is checked).
- Right. Clean and Rebuild your project if needed. To double check it run your project or export as WAR file. Open your war file and a Project Dependency packed in a JAR should be there.