I have the use case in which I need to write some properties to the spring boot application.yml file for each Spring boot profile at the maven build time.
Input(application.yml) :
spring:
profiles: ED
eureka:
client:
enabled: true
availabilityZones:
us-west-2: us-west-2a,us-west-2b
serviceUrl:
us-west-2a: http://regdiscovery:${eureka.environment}@memeboot-regdiscovery1-ed.aord.expertcity.com:8080/eureka/
---
spring:
profiles: RC
eureka:
client:
enabled: true
availabilityZones:
us-west-2: us-west-2a,us-west-2b
serviceUrl:
us-west-2a: http://regdiscovery:${eureka.environment}@memeboot-regdiscovery1-rc.aord.expertcity.com:8080/eureka/
Expected output(application.yml after maven build):
spring:
profiles: ED
eureka:
client:
enabled: true
availabilityZones:
us-west-2: us-west-2a,us-west-2b
serviceUrl:
defaultZone: dummy-url-1,dummy-url-2
us-west-2a: http://regdiscovery:${eureka.environment}@memeboot-regdiscovery1-ed.aord.expertcity.com:8080/eureka/
---
spring:
profiles: RC
eureka:
client:
enabled: true
availabilityZones:
us-west-2: us-west-2a,us-west-2b
serviceUrl:
defaultZone: dummy-url-1,dummy-url-2
us-west-2a: http://regdiscovery:${eureka.environment}@memeboot-regdiscovery1-rc.aord.expertcity.com:8080/eureka/
Please notice the added line defaultZone: dummy-url-1,dummy-url-2
in the expected output. Is there any maven plugin available to achieve this ?