I have a Spring Boot application (running in Docker, but I don't think that's relevant) that I start as follows:
java -Dspring.profiles.active=development,docker -jar /app.jar
My Spring Boot development
profile includes an entry:
service.baseurl: http://foo
My Spring Boot docker
profile includes an entry:
service.baseurl: http://bar
My understanding of how Spring profiles work is that values are picked up from the LAST value found when there are multiple profiles (see https://stackoverflow.com/a/51565684/2117355). Based on this, I would expect that my application loads http://bar
as the value for service.baseurl
. This is in fact what happens on my development machine.
However, on my teammate's machine, the value loaded for service.baseurl
is http://foo
.
This one is a real head-scratcher. Could there be some setting, or version of something, on my teammate's machine that is causing her to get different results here?
For what it's worth, we are both running:
- Java JDK 16.0.2
- Spring Boot 2.5.4
- Gradle 7.2
- Docker 20.10.8