I just upgraded the Spring Boot Starter Parent dependency 2.7.5 --> 3.0.2.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.2</version>
<relativePath />
</parent>
Note that the application.yml already has the following Legacy Processing mode setting, which should prevent the error below:
spring.config.use-legacy-processing: true
There are different profiles defined in application.yml as follows:
spring:
profiles.active: dev
profiles: dev
rails:
url: ...
userIdentifier: ...
service: FILESERVICE
methodInBody: POST
uri: /api/external-interfaces/file-locations
---
spring:
profiles: stage
rails:
url: ...
userIdentifier: ...
service: FILESERVICE
methodInBody: POST
uri: /api/external-interfaces/file-locations
jackson:
serialization:
indent-output: true
---
spring:
profiles: prod
rails:
url: ...
userIdentifier: ...
service: FILESERVICE
methodInBody: POST
uri: /api/external-interfaces/file-locations
Error on mvn spring-boot:run
:
org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles' imported from location 'class path resource [application.yml]' is invalid and should be replaced with 'spring.config.activate.on-profile' [origin: class path resource [application.yml] - 41:13]
Do I just need to replace all 3 occurrences of profiles:
with spring.config.activate.on-profile:
?