Search code examples
spring-bootenvironment-variablesspring-profiles

Change Profile Value of a Dependency In Spring Boot


I work on a Spring Boot project A, that has project B as a Dependency in pom.xml . Project B is a Spring boot project as well and integrates Spring Cloud. I have written some tests in project A and I would like to set the property spring.cloud.kubernetes.enabled to "false" of project B, only when I run the tests in project A. I know that inheriting configuration from a depencency is possible, but is the opposite possible?

So far tried to work with Profiles, with no success.


Solution

  • The docs say you can disable this feature by setting the property

    spring.main.cloud-platform=NONE
    

    You just need to figure out how to set this property when running your tests.