I’ve a Java project which has some resources located in a folder named files in the root of the project. When the project is running, this files folder is scanned for known resources. This is working fine when running this project on it own.
But I’ve a Web Project in Eclipse with a servlet. This web project has a dependency to the above java project. The project is added under Java Build Path -> Projects. But when running the above project from the servlet, the files folder does not exists. How can I add this folder from the dependent project to the web project?
If your dependent problem is added as jar, you can access it’s resources via
ClassFromDependentProject.class.getClassLoader().getResourceAsStream(pathToResource). Eclipse will access resources from dependent projects directly, and in runtime they are available via jar.