Spring Suite tool finds spring test integration integration test and does not start the main application

I have a little struggle with Spring Tool Suite in combination with spring-boot.

I created a custom Maven application spring-boot-web-application that includes several JUnit tests, one of which is an integration test, which has a configuration for the test application.

If I want to launch a spring-boot-web application through the Spring Tool Suite (run as → Spring application to download), the application does not start because both configurations (src / main / java, src / test / java) are found and conflicting with friend.

As soon as I remove the test resources from the build path, the application starts as expected.

Is there any parameter in the Spring Tool Suite to prevent adding test resources to the classpath when running the spring-boot-web application?

Thank you in advance!

+1
spring-boot spring-tool-suite
source share
1 answer

In STS 3.6.4, there is an error in it that causes the class path for "Run As → Spring Boot App" on maven projects to include "test material" (source folders and jar dependencies) to be in the path to the runtime.

An error is a regression by which 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 into the "work with" field, and then install "Kernel". The installer will inform you that you already have these files and will perform the update.

After this update is successful, the “Run As → Boot App” will no longer contain test materials in the path to the runtime.

0
source share

All Articles