I am using Eclipse (4.2 Juno) with m2e with default settings. The source code is in src/main/java, and the test code is in src/test/java.
Sometimes I inadvertently do importsome things from test to class mostly. Eclipse does not complain about it (both src/main/javaand src/test/javasimply configured as source folders using m2e), and all tests are run properly, because the test environment (JUnit) can get access to the code of the main and test. However, when I try to run the main code myself later (after it was supposedly checked), I will inevitably get a bunch ClassNotFoundExceptionwhen I try to use the code.
Is there a way to make Eclipse show errors or warnings when this happens?
source
share