Allow to filter available Spring Boot versions

This commit adds a new InitializrMetadataUpdateStrategy callback
interface that can be used to customize what should happen when the
metadata has to be refreshed.

Closes gh-816
This commit is contained in:
Stephane Nicoll
2019-02-08 16:42:45 +01:00
parent fe4d05d1f6
commit cbb60c45e1
10 changed files with 324 additions and 164 deletions

View File

@@ -124,18 +124,15 @@ details, {spring-boot-reference}/#boot-features-restclient-customization[check t
documentation].
If you don't want the version to be upgraded automatically, you need to override the
`InitializrMetadataProvider` bean to provide your own metadata for the service. For
instance, you could swap to an implementation that always returns the contents of static
`application.yml`:
`InitializrMetadataUpdateStrategy` bean to provide your own strategy when the metadata has
to be refreshed. For instance, you could swap to an implementation that always returns the
contents of static `application.yml`:
[source,java,indent=0]
----
@Bean
public InitializrMetadataProvider initializrMetadataProvider(
InitializrProperties properties) {
InitializrMetadata metadata = InitializrMetadataBuilder
.fromInitializrProperties(properties).build();
return new SimpleInitializrMetadataProvider(metadata);
public InitializrMetadataUpdateStrategy initializrMetadataUpdateStrategy() {
return (metadata) -> metadata;
}
----