Skip to content

Properties migrator causes an application to fail to start if it tries to map a property whose metadata data entry contains an invalid configuration property name #32729

@larsgrefer

Description

@larsgrefer

TL;DR: The spring-boot-configuration-processor should check for (or fix) invalid configuration property names found in META-INF/additional-spring-configuration-metadata.json at compile time.

We currently have the following situation:

  1. There is an invalid property name in META-INF/additional-spring-configuration-metadata.json of an external library.
  2. When the library is compiled, spring-boot-configuration-processor copies the invalid property name over to META-INF/spring-configuration-metadata.json.
  3. Our application depends on both the library and spring-boot-properties-migrator
  4. Our application fails to start with a org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException.

Since the library is an external dependency out of our control, our only option is to exclude spring-boot-properties-migrator in our application until the metadata is fixed by the author of the external library.

This problem could have been prevented, if the invalid name were already caught in Step 2.
I therefore propose that spring-boot-configuration-processor should check META-INF/additional-spring-configuration-metadata.json for invalid property names, before copying them over to META-INF/spring-configuration-metadata.json. It can then either fail the compilation or convert the properties to their correct form.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions