2

Spring Boot devtools allow you to define global configuration outside of your application sources by placing a file .spring-boot-devtools.properties into your home directory, which takes precedence over the bundled configuration, according to:

https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html

However, this file also applies when running unit tests, so if you have tests that depend on some configuration, either the defaults defined in bundled application.properties or in test-specific properties defined by @TestPropertySource, they are still overridden by the global values and your build breaks.

Is there some reasonable way how to either ignore the .spring-boot-devtools.properties or to exclude the devtools from the test classpath altogether (we're using Gradle)?

Natix
  • 14,017
  • 7
  • 54
  • 69

0 Answers0