From a324c7de87f4f4365fc35912f795fd5d0cfb30cd Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Mon, 17 Mar 2025 10:55:36 +0800 Subject: [PATCH] Polish usage of @ConfigurationProperties Signed-off-by: Yanming Zhou --- .../autoconfigure/web/server/ManagementServerProperties.java | 2 +- .../groovy/template/GroovyTemplateProperties.java | 4 ++-- .../boot/autoconfigure/web/ServerProperties.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java index c5e7ca7321fc..527b5f1bbeb8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java @@ -34,7 +34,7 @@ * @since 2.0.0 * @see ServerProperties */ -@ConfigurationProperties(prefix = "management.server", ignoreUnknownFields = true) +@ConfigurationProperties("management.server") public class ManagementServerProperties { /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateProperties.java index ba548bad857c..85c694d3c916 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ * @author Marten Deinum * @since 1.1.0 */ -@ConfigurationProperties(prefix = "spring.groovy.template", ignoreUnknownFields = true) +@ConfigurationProperties("spring.groovy.template") public class GroovyTemplateProperties extends AbstractTemplateViewResolverProperties { public static final String DEFAULT_RESOURCE_LOADER_PATH = "classpath:/templates/"; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 252d91b1b7df..97bf7e0f3a62 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -75,7 +75,7 @@ * @author Lasse Wulff * @since 1.0.0 */ -@ConfigurationProperties(prefix = "server", ignoreUnknownFields = true) +@ConfigurationProperties("server") public class ServerProperties { /**