Ideally, it should be possible to have full control over what gets exposed and to do so without setting individual properties to null, i.e. if I want to only expose name and version I should be able to achieve that using something like:

springBoot {
    buildInfo {
        // use some flag here to disable defaults?
        properties {
            name = project.name
            version = project.version
        }
    }
}

This is something to consider for 3.x.

See #27092 for background.

Comment From: wilkinsona

We've discussed this today and concluded that we don't think the benefits are sufficiently compelling to make the change. We've seen very little demand for this and people generally seem happy with the defaults. Anyone who wishes to filter things can do so with the current mechanisms in the build plugins. Alternatively, you can post-process the properties file or define a custom BuildProperties bean that overrides its methods to customize the properties that it exposes. Thanks anyway for the suggestion.