I am running a Spring Boot application (java main function) in the eclipse. It is a maven based project. I think eclipse uses m2e plugin to run it. But every time I run my project, the test-classes folder is added to the classpath in the final command.
I have to manually remove the test folder (src/test/java and src/test/resources) from source folder in all sub-projects. But when I right click the project, Maven -> Update Project... , the test folder be added to source folder again automatically. Then the final test-classes folder be added into classpath for the run command.