I wanted to use a local project as a library in a new project so I added it as a library. I selected "Project Structure" and then "Libraries" > "New Project Library" (the green plus sign) > "Java" and selected the other project's root. Now I could use the imported project classes, meaning there were no compilation errors. However, at runtime (specifically when launching Tomcat), I am getting errors saying the imported project's packages don't exist.
How can I solve this issue? How can I import a local project with IntelliJ and have it recognized at runtime as well?