Skip to content

Property expansion not working as documented when using maven build profile #46523

@meganjohn

Description

@meganjohn

When using Spring Boot Starter Parent 3.5.3 with Maven build profiles, the documented property expansion doesn't work without disabling profile validation.

According to the documentation, to expand properties using a Maven application.yml I should be able to use "@...@" to reference my Maven property but on trying to build I get an error. Setting spring.profiles.validate=false resolves the issue but shouldn't be necessary.

Error on start up:

Description:

Failed to bind properties under 'spring.profiles.active' to java.util.Set<java.lang.String>:

    Property: spring.profiles.active
    Value: "@spring.profiles.active@"
    Origin: class path resource [application.yml] - 7:17
    Reason: java.lang.IllegalStateException: Profile '@spring.profiles.active@' must start and end with a letter or digit

Link to example project with the issue: property-expansion

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions