diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java index 65e6045acc3..9a977da8c54 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointMBeanExportProperties.java @@ -26,7 +26,7 @@ import org.springframework.util.StringUtils; * * @author Christian Dupuis */ -@ConfigurationProperties(name = "endpoints.jmx") +@ConfigurationProperties(prefix = "endpoints.jmx") public class EndpointMBeanExportProperties { private String domain; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaProperties.java index 019973ba4d4..65cdbc22403 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaProperties.java @@ -27,7 +27,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Christian Dupuis * @author Dave Syer */ -@ConfigurationProperties(name = "jolokia") +@ConfigurationProperties(prefix = "jolokia") public class JolokiaProperties { private Map config = new HashMap(); diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java index 5b45782000d..fe9374bc369 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java @@ -32,7 +32,7 @@ import org.springframework.util.ClassUtils; * @author Dave Syer * @see ServerProperties */ -@ConfigurationProperties(name = "management", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "management", ignoreUnknownFields = false) public class ManagementServerProperties implements SecurityPrequisite { private static final String SECURITY_CHECK_CLASS = "org.springframework.security.config.http.SessionCreationPolicy"; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java index e2f9050e94b..b8cee691735 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -36,7 +36,7 @@ import org.springframework.util.StringUtils; * @author Christian Dupuis * @author Phillip Webb */ -@ConfigurationProperties(name = "shell", ignoreUnknownFields = true) +@ConfigurationProperties(prefix = "shell", ignoreUnknownFields = true) public class ShellProperties { private static Log logger = LogFactory.getLog(ShellProperties.class); @@ -279,7 +279,7 @@ public class ShellProperties { /** * Auth specific properties for JAAS authentication */ - @ConfigurationProperties(name = "shell.auth.jaas", ignoreUnknownFields = false) + @ConfigurationProperties(prefix = "shell.auth.jaas", ignoreUnknownFields = false) public static class JaasAuthenticationProperties extends CrshShellAuthenticationProperties { @@ -305,7 +305,7 @@ public class ShellProperties { /** * Auth specific properties for key authentication */ - @ConfigurationProperties(name = "shell.auth.key", ignoreUnknownFields = false) + @ConfigurationProperties(prefix = "shell.auth.key", ignoreUnknownFields = false) public static class KeyAuthenticationProperties extends CrshShellAuthenticationProperties { @@ -333,7 +333,7 @@ public class ShellProperties { /** * Auth specific properties for simple authentication */ - @ConfigurationProperties(name = "shell.auth.simple", ignoreUnknownFields = false) + @ConfigurationProperties(prefix = "shell.auth.simple", ignoreUnknownFields = false) public static class SimpleAuthenticationProperties extends CrshShellAuthenticationProperties { @@ -402,7 +402,7 @@ public class ShellProperties { /** * Auth specific properties for Spring authentication */ - @ConfigurationProperties(name = "shell.auth.spring", ignoreUnknownFields = false) + @ConfigurationProperties(prefix = "shell.auth.spring", ignoreUnknownFields = false) public static class SpringAuthenticationProperties extends CrshShellAuthenticationProperties { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java index e707a4cf94f..e668ea7d738 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -43,7 +43,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; * @author Phillip Webb * @author Dave Syer */ -@ConfigurationProperties(name = "endpoints.autoconfig", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.autoconfig", ignoreUnknownFields = false) public class AutoConfigurationReportEndpoint extends AbstractEndpoint { @Autowired diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/BeansEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/BeansEndpoint.java index 12178983e48..8b02218455c 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/BeansEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/BeansEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -35,7 +35,7 @@ import org.springframework.core.env.Environment; * * @author Dave Syer */ -@ConfigurationProperties(name = "endpoints.beans", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.beans", ignoreUnknownFields = false) public class BeansEndpoint extends AbstractEndpoint> implements ApplicationContextAware { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java index 132b7165a03..9a095fb43b5 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java @@ -48,7 +48,7 @@ import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; * * @author Christian Dupuis */ -@ConfigurationProperties(name = "endpoints.configprops", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.configprops", ignoreUnknownFields = false) public class ConfigurationPropertiesReportEndpoint extends AbstractEndpoint> implements ApplicationContextAware { @@ -138,7 +138,7 @@ public class ConfigurationPropertiesReportEndpoint extends ConfigurationProperties annotation = AnnotationUtils.findAnnotation( bean.getClass(), ConfigurationProperties.class); return (StringUtils.hasLength(annotation.value()) ? annotation.value() - : annotation.name()); + : annotation.prefix()); } /** diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/DumpEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/DumpEndpoint.java index 26ac45e35ea..d635fb91184 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/DumpEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/DumpEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -28,7 +28,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * * @author Dave Syer */ -@ConfigurationProperties(name = "endpoints.dump", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.dump", ignoreUnknownFields = false) public class DumpEndpoint extends AbstractEndpoint> { /** diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java index 649d9d0a861..6c62835272b 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -33,7 +33,7 @@ import org.springframework.core.env.StandardEnvironment; * @author Dave Syer * @author Phillip Webb */ -@ConfigurationProperties(name = "endpoints.env", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.env", ignoreUnknownFields = false) public class EnvironmentEndpoint extends AbstractEndpoint> implements EnvironmentAware { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/HealthEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/HealthEndpoint.java index 1b19355ab6c..51bbcef8b20 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/HealthEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/HealthEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -25,7 +25,7 @@ import org.springframework.util.Assert; * * @author Dave Syer */ -@ConfigurationProperties(name = "endpoints.health", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.health", ignoreUnknownFields = false) public class HealthEndpoint extends AbstractEndpoint { private final HealthIndicator indicator; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InfoEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InfoEndpoint.java index 5a87eaa7494..515440dbe02 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InfoEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InfoEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -28,7 +28,7 @@ import org.springframework.util.Assert; * * @author Dave Syer */ -@ConfigurationProperties(name = "endpoints.info", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.info", ignoreUnknownFields = false) public class InfoEndpoint extends AbstractEndpoint> { private final Map info; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/MetricsEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/MetricsEndpoint.java index 478eb1d131c..ae3f44d5c46 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/MetricsEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/MetricsEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -28,7 +28,7 @@ import org.springframework.util.Assert; * * @author Dave Syer */ -@ConfigurationProperties(name = "endpoints.metrics", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.metrics", ignoreUnknownFields = false) public class MetricsEndpoint extends AbstractEndpoint> { private final PublicMetrics metrics; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ShutdownEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ShutdownEndpoint.java index ad814e70c16..cee60042e91 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ShutdownEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ShutdownEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -31,7 +31,7 @@ import org.springframework.context.ConfigurableApplicationContext; * @author Dave Syer * @author Christian Dupuis */ -@ConfigurationProperties(name = "endpoints.shutdown", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.shutdown", ignoreUnknownFields = false) public class ShutdownEndpoint extends AbstractEndpoint> implements ApplicationContextAware { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java index 2227f81c983..0dc5f3b08d6 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java @@ -28,7 +28,7 @@ import org.springframework.util.Assert; * * @author Dave Syer */ -@ConfigurationProperties(name = "endpoints.trace", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.trace", ignoreUnknownFields = false) public class TraceEndpoint extends AbstractEndpoint> { private final TraceRepository repository; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java index e41182da9fc..50b7f6483a8 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java @@ -42,7 +42,7 @@ import org.springframework.web.servlet.mvc.ServletWrappingController; * * @author Christian Dupuis */ -@ConfigurationProperties(name = "endpoints.jolokia", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "endpoints.jolokia", ignoreUnknownFields = false) public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean, ApplicationContextAware, ServletContextAware { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java index bf6cce4edb7..15bcf065284 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java @@ -34,7 +34,7 @@ import org.springframework.web.context.request.RequestContextHolder; * * @author Dave Syer */ -@ConfigurationProperties(name = "error") +@ConfigurationProperties(prefix = "error") public class ManagementErrorEndpoint implements MvcEndpoint { private final ErrorController controller; diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointParentTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointParentTests.java index e45923e9677..9f03e47b0d9 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointParentTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointParentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -86,7 +86,7 @@ public class ConfigurationPropertiesReportEndpointParentTests { } - @ConfigurationProperties(name = "test") + @ConfigurationProperties(prefix = "test") public static class TestProperties { private String myTestProperty = "654321"; diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointTests.java index 62274bf015d..108057c633a 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -104,7 +104,7 @@ public class ConfigurationPropertiesReportEndpointTests extends } - @ConfigurationProperties(name = "test") + @ConfigurationProperties(prefix = "test") public static class TestProperties { private String dbPassword = "123456"; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java index 9241f646673..ad05afeb4e5 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java @@ -25,7 +25,7 @@ import org.springframework.util.StringUtils; * @author Greg Turnquist * @author Dave Syer */ -@ConfigurationProperties(name = "spring.rabbitmq") +@ConfigurationProperties(prefix = "spring.rabbitmq") public class RabbitProperties { private String host = "localhost"; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/AbstractDataSourceConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/AbstractDataSourceConfiguration.java index 4923fd562de..87c85c8a2f1 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/AbstractDataSourceConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/AbstractDataSourceConfiguration.java @@ -28,7 +28,7 @@ import org.springframework.util.StringUtils; * * @author Dave Syer */ -@ConfigurationProperties(name = DataSourceAutoConfiguration.CONFIGURATION_PREFIX) +@ConfigurationProperties(prefix = DataSourceAutoConfiguration.CONFIGURATION_PREFIX) @EnableConfigurationProperties public abstract class AbstractDataSourceConfiguration implements BeanClassLoaderAware, InitializingBean { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/ActiveMQProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/ActiveMQProperties.java index 15afdeff9bc..1d616e3f8de 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/ActiveMQProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/ActiveMQProperties.java @@ -23,7 +23,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * * @author Greg Turnquist */ -@ConfigurationProperties(name = "spring.activemq") +@ConfigurationProperties(prefix = "spring.activemq") public class ActiveMQProperties { private String brokerUrl = "tcp://localhost:61616"; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsTemplateProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsTemplateProperties.java index a9235ea7c6f..8da31178b66 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsTemplateProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsTemplateProperties.java @@ -18,7 +18,7 @@ package org.springframework.boot.autoconfigure.jms; import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties(name = "spring.jms") +@ConfigurationProperties(prefix = "spring.jms") public class JmsTemplateProperties { private boolean pubSubDomain = true; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java index d15d3321b05..be45ad716ed 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java @@ -30,7 +30,7 @@ import com.mongodb.MongoClientURI; * @author Dave Syer * @author Phillip Webb */ -@ConfigurationProperties(name = "spring.data.mongodb") +@ConfigurationProperties(prefix = "spring.data.mongodb") public class MongoProperties { private String host; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisProperties.java index 8a1e8e0e590..0a09022d6c2 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisProperties.java @@ -23,7 +23,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * * @author Dave Syer */ -@ConfigurationProperties(name = "spring.redis") +@ConfigurationProperties(prefix = "spring.redis") public class RedisProperties { private String host = "localhost"; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java index 41f23da1f07..76b51928b5b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -30,7 +30,7 @@ import org.springframework.util.StringUtils; * * @author Dave Syer */ -@ConfigurationProperties(name = "security", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "security", ignoreUnknownFields = false) public class SecurityProperties implements SecurityPrequisite { private boolean requireSsl; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java index 168b93978a5..a301167d7a6 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMapperProperties.java @@ -25,7 +25,7 @@ import org.springframework.http.converter.HttpMessageConverter; * @author Dave Syer * @author Piotr Maj */ -@ConfigurationProperties(name = "http.mappers", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "http.mappers", ignoreUnknownFields = false) public class HttpMapperProperties { private boolean jsonPrettyPrint; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 16ab3b77e3e..c74b0584762 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -44,7 +44,7 @@ import org.springframework.util.StringUtils; * * @author Dave Syer */ -@ConfigurationProperties(name = "server", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "server", ignoreUnknownFields = false) public class ServerProperties implements EmbeddedServletContainerCustomizer { private Integer port; diff --git a/spring-boot-samples/spring-boot-sample-actuator-log4j/src/main/java/sample/actuator/log4j/ServiceProperties.java b/spring-boot-samples/spring-boot-sample-actuator-log4j/src/main/java/sample/actuator/log4j/ServiceProperties.java index 4a8dcee1e4d..65194e1443b 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-log4j/src/main/java/sample/actuator/log4j/ServiceProperties.java +++ b/spring-boot-samples/spring-boot-sample-actuator-log4j/src/main/java/sample/actuator/log4j/ServiceProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -19,7 +19,7 @@ package sample.actuator.log4j; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; -@ConfigurationProperties(name = "service", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "service", ignoreUnknownFields = false) @Component public class ServiceProperties { diff --git a/spring-boot-samples/spring-boot-sample-actuator-noweb/src/main/java/sample/actuator/ServiceProperties.java b/spring-boot-samples/spring-boot-sample-actuator-noweb/src/main/java/sample/actuator/ServiceProperties.java index d2de3465e28..44a0f581ebf 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-noweb/src/main/java/sample/actuator/ServiceProperties.java +++ b/spring-boot-samples/spring-boot-sample-actuator-noweb/src/main/java/sample/actuator/ServiceProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -19,7 +19,7 @@ package sample.actuator; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; -@ConfigurationProperties(name = "service", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "service", ignoreUnknownFields = false) @Component public class ServiceProperties { diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/ServiceProperties.java b/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/ServiceProperties.java index d2de3465e28..44a0f581ebf 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/ServiceProperties.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/ServiceProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -19,7 +19,7 @@ package sample.actuator; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; -@ConfigurationProperties(name = "service", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "service", ignoreUnknownFields = false) @Component public class ServiceProperties { diff --git a/spring-boot-samples/spring-boot-sample-integration/src/main/java/sample/integration/ServiceProperties.java b/spring-boot-samples/spring-boot-sample-integration/src/main/java/sample/integration/ServiceProperties.java index 90674b60fe2..b367ed44e31 100644 --- a/spring-boot-samples/spring-boot-sample-integration/src/main/java/sample/integration/ServiceProperties.java +++ b/spring-boot-samples/spring-boot-sample-integration/src/main/java/sample/integration/ServiceProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -18,7 +18,7 @@ package sample.integration; import org.springframework.boot.context.properties.ConfigurationProperties; -@ConfigurationProperties(name = "service", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "service", ignoreUnknownFields = false) public class ServiceProperties { private String greeting = "Hello"; diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java index a161f62ddd8..7a14cdf6516 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 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. @@ -35,20 +35,18 @@ import java.lang.annotation.Target; public @interface ConfigurationProperties { /** - * The (optional) name of the object to be bound. Properties to bind can have a name - * prefix to select the properties that are valid to this object. Synonym for - * {@link #name()}. + * The name prefix of the properties that are valid to bind to this object. Synonym + * for {@link #prefix()}. * @return the name prefix of the properties to bind */ String value() default ""; /** - * The (optional) name of the object to be bound. Properties to bind can have a name - * prefix to select the properties that are valid to this object. Synonym for - * {@link #value()}. + * The name prefix of the properties that are valid to bind to this object. Synonym + * for {@link #value()}. * @return the name prefix of the properties to bind */ - String name() default ""; + String prefix() default ""; /** * Flag to indicate that when binding to this object invalid fields should be ignored. @@ -80,10 +78,10 @@ public @interface ConfigurationProperties { boolean exceptionIfInvalid() default true; /** - * Optionally provide an explicit resource path to bind to instead of using the + * Optionally provide an explicit resource locations to bind to instead of using the * default environment. * @return the path (or paths) of resources to bind to */ - String[] path() default {}; + String[] locations() default {}; } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index 44432d7e28a..6ba45f10fb7 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -292,8 +292,8 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc .getTarget() : bean); PropertiesConfigurationFactory factory = new PropertiesConfigurationFactory( target); - if (annotation != null && annotation.path().length != 0) { - factory.setPropertySources(loadPropertySources(annotation.path())); + if (annotation != null && annotation.locations().length != 0) { + factory.setPropertySources(loadPropertySources(annotation.locations())); } else { factory.setPropertySources(this.propertySources); @@ -309,7 +309,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc factory.setExceptionIfInvalid(annotation.exceptionIfInvalid()); factory.setIgnoreNestedProperties(annotation.ignoreNestedProperties()); String targetName = (StringUtils.hasLength(annotation.value()) ? annotation - .value() : annotation.name()); + .value() : annotation.prefix()); if (StringUtils.hasLength(targetName)) { factory.setTargetName(targetName); } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector.java index 4ad872279f2..a6f739c0941 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector.java @@ -83,7 +83,7 @@ class EnableConfigurationPropertiesImportSelector implements ImportSelector { ConfigurationProperties.class); if (annotation != null) { return (StringUtils.hasLength(annotation.value()) ? annotation.value() - : annotation.name()); + : annotation.prefix()); } return ""; } diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java index d5142558d70..73ecf153227 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessorTests.java @@ -128,7 +128,7 @@ public class ConfigurationPropertiesBindingPostProcessorTests { } - @ConfigurationProperties(name = "test") + @ConfigurationProperties(prefix = "test") public static class PropertyWithValidatingSetter { private String foo; @@ -157,7 +157,7 @@ public class ConfigurationPropertiesBindingPostProcessorTests { } - @ConfigurationProperties(name = "test") + @ConfigurationProperties(prefix = "test") public static class PropertyWithoutJSR303 implements Validator { private String foo; @@ -215,7 +215,7 @@ public class ConfigurationPropertiesBindingPostProcessorTests { } - @ConfigurationProperties(name = "test") + @ConfigurationProperties(prefix = "test") public static class PropertyWithJSR303 extends PropertyWithoutJSR303 { @NotNull diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java index 37688c33a2b..f8a8d10dc6a 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesTests.java @@ -464,7 +464,7 @@ public class EnableConfigurationPropertiesTests { public static class SystemExampleConfig { } - @ConfigurationProperties(name = "external") + @ConfigurationProperties(prefix = "external") public static class External { private String name; @@ -478,7 +478,7 @@ public class EnableConfigurationPropertiesTests { } } - @ConfigurationProperties(name = "another") + @ConfigurationProperties(prefix = "another") public static class Another { private String name; @@ -492,7 +492,7 @@ public class EnableConfigurationPropertiesTests { } } - @ConfigurationProperties(name = "spring_test_external") + @ConfigurationProperties(prefix = "spring_test_external") public static class SystemEnvVar { public String getVal() { @@ -602,7 +602,7 @@ public class EnableConfigurationPropertiesTests { protected static class StrictTestProperties extends TestProperties { } - @ConfigurationProperties(name = "spring.foo") + @ConfigurationProperties(prefix = "spring.foo") protected static class EmbeddedTestProperties extends TestProperties { } @@ -653,7 +653,7 @@ public class EnableConfigurationPropertiesTests { // No getter - you should be able to bind to a write-only bean } - @ConfigurationProperties(path = "${binding.location:classpath:name.yml}") + @ConfigurationProperties(locations = "${binding.location:classpath:name.yml}") protected static class ResourceBindingProperties { private String name; @@ -666,7 +666,7 @@ public class EnableConfigurationPropertiesTests { } @EnableConfigurationProperties - @ConfigurationProperties(path = "${binding.location:classpath:map.yml}") + @ConfigurationProperties(locations = "${binding.location:classpath:map.yml}") protected static class ResourceBindingPropertiesWithMap { private Map mymap;