paketo-buildpacks / spring-boot

A Cloud Native Buildpack that contributes Spring Boot dependency information and slices an application into multiple layers
Apache License 2.0
164 stars 21 forks source link

Add support for configuration-properties.names #456

Open tinedel opened 3 months ago

tinedel commented 3 months ago

Describe the Enhancement

According to the dataflow documentation two properties are supported configuration-properties.classes and configuration-properties.names in the dataflow-configuration-metadata.properties file. This buildpack support only the first one - classes, completely ignoring names.

It would be nice to be able to specify also names.

Possible Solution

There is a question which is not quite clear to me. From what I can see in the documentation names and classes are additive. If my understanding is correct then the solution is as follows:

In boot/congifuration_metadata.go in NewDataFlowConfigurationMetadata function add a section to process names. It will need to iterate through properties, hints, and groups and add matching properties to Properties, Hints, and Groups respectively.

Motivation

While looking for a class mapping corresponding property and adding the class itself to the configuration-properties.classes property is a viable workaround, this path is confusing and to my best knowledge undocumented. Adding this feature will save a lot of hair loss to future users.