So I have say two projects, project A and project B. Project A contains a main class which I want to run. Project B contains some classpath resources which are required and also has a reference to Project A. If I run the main class in Project A directly, it will only run it in the context of that project and won’t include the classpath resources as they’re in Project B.
But if I try to run Project B, I can’t select the main class (as it doesn’t exist in that project) and if I try right-clicking the project -> Run As -> Java Application, it doesn’t come up with that main class as a valid main class. (It does come up in the similar dialog for Project A.)
This seems to be a common problem from Eclipse; I found this related question but this person is not using Maven. Also, they accepted an answer which referenced project B from project A, which breaks the encapsulation I am trying to achieve here:
Eclipse 3,6 (Helios) referenced project has main method, cannot access from run config when targeting referencing project
Options I can think of: