I have a little struggle with Spring Tool Suite in combination with spring-boot.
I created a custom Maven spring-boot-web-application including several JUnit tests, one of this test is an integration test which has a configuration for the testapplication.
If I want to start the spring-boot-web-application via Spring Tool Suite ( run as -> Spring Boot Application ) the application does not start because both configurations ( src/main/java, src/test/java ) are found and conflict each other.
As soon I remove the test resources from the buildpath the application starts as expected.
Is there any setting in Spring Tool Suite to prevent the test resources are added to the classpath when starting the spring-boot-web-application?
Thank you in advance!
STS 3.6.4 has a bug in it that causes the classpath for "Run As >> Spring Boot App" on maven projects to include 'test stuff' (source folders and jar dependencies) to be on the runtime classpath.
The bug is a regression as it did not exist in 3.6.3. The bug is fixed already in master and the fix will be part of STS 3.7.0. You can get this fix today by updating your STS installation from the nightly update site:
http://dist.springframework.org/snapshot/IDE/nightly/
Open "Help >> Install New Software" and paste the above link in the "work with" field and then install the "Core" pieces. The installer will inform you that you already have these and will perform an upgrade instead.
After this upgrade is succesful, "Run As >> Boot App" should no longer have test stuff on the runtime classpath.