diff --git a/spring-boot-samples/spring-boot-sample-actuator-ui/src/main/java/sample/actuator/ui/SampleActuatorUiApplication.java b/spring-boot-samples/spring-boot-sample-actuator-ui/src/main/java/sample/actuator/ui/SampleActuatorUiApplication.java index 5c8357e89f..4f5b2b0fcf 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-ui/src/main/java/sample/actuator/ui/SampleActuatorUiApplication.java +++ b/spring-boot-samples/spring-boot-sample-actuator-ui/src/main/java/sample/actuator/ui/SampleActuatorUiApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -20,15 +20,13 @@ import java.util.Date; import java.util.Map; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication @Controller public class SampleActuatorUiApplication { diff --git a/spring-boot-samples/spring-boot-sample-hateoas/src/main/java/sample/hateoas/SampleHateoasApplication.java b/spring-boot-samples/spring-boot-sample-hateoas/src/main/java/sample/hateoas/SampleHateoasApplication.java index a5799a0754..b2af19c65a 100644 --- a/spring-boot-samples/spring-boot-sample-hateoas/src/main/java/sample/hateoas/SampleHateoasApplication.java +++ b/spring-boot-samples/spring-boot-sample-hateoas/src/main/java/sample/hateoas/SampleHateoasApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -17,13 +17,9 @@ package sample.hateoas; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.SpringBootApplication; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleHateoasApplication { public static void main(String[] args) { diff --git a/spring-boot-samples/spring-boot-sample-servlet/src/main/java/sample/servlet/SampleServletApplication.java b/spring-boot-samples/spring-boot-sample-servlet/src/main/java/sample/servlet/SampleServletApplication.java index 92352eabaf..513b9ff828 100644 --- a/spring-boot-samples/spring-boot-sample-servlet/src/main/java/sample/servlet/SampleServletApplication.java +++ b/spring-boot-samples/spring-boot-sample-servlet/src/main/java/sample/servlet/SampleServletApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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,13 +25,13 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import org.springframework.boot.SpringApplication; +import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.web.SpringBootServletInitializer; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -@Configuration +@SpringBootConfiguration @EnableAutoConfiguration public class SampleServletApplication extends SpringBootServletInitializer { diff --git a/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/SampleTomcatSslApplicationTests.java b/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/ssl/SampleTomcatSslApplicationTests.java similarity index 96% rename from spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/SampleTomcatSslApplicationTests.java rename to spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/ssl/SampleTomcatSslApplicationTests.java index 4b353b472b..3e3b088507 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/SampleTomcatSslApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/ssl/SampleTomcatSslApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package sample.tomcat; +package sample.tomcat.ssl; import org.apache.http.client.HttpClient; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; diff --git a/spring-boot-samples/spring-boot-sample-web-method-security/src/main/java/sample/security/method/SampleMethodSecurityApplication.java b/spring-boot-samples/spring-boot-sample-web-method-security/src/main/java/sample/security/method/SampleMethodSecurityApplication.java index 228ec19992..a31a041af8 100644 --- a/spring-boot-samples/spring-boot-sample-web-method-security/src/main/java/sample/security/method/SampleMethodSecurityApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-method-security/src/main/java/sample/security/method/SampleMethodSecurityApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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,11 +19,10 @@ package sample.security.method; import java.util.Date; import java.util.Map; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; @@ -39,8 +38,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication @EnableGlobalMethodSecurity(securedEnabled = true) public class SampleMethodSecurityApplication extends WebMvcConfigurerAdapter { diff --git a/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java b/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java index e43e04d91a..d05c328a76 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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,11 +19,10 @@ package sample.web.secure.custom; import java.util.Date; import java.util.Map; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; import org.springframework.core.annotation.Order; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; @@ -33,8 +32,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication @Controller public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter { diff --git a/spring-boot-samples/spring-boot-sample-web-secure-custom/src/test/java/sample/ui/secure/SampleWebSecureCustomApplicationTests.java b/spring-boot-samples/spring-boot-sample-web-secure-custom/src/test/java/sample/web/secure/custom/SampleWebSecureCustomApplicationTests.java similarity index 98% rename from spring-boot-samples/spring-boot-sample-web-secure-custom/src/test/java/sample/ui/secure/SampleWebSecureCustomApplicationTests.java rename to spring-boot-samples/spring-boot-sample-web-secure-custom/src/test/java/sample/web/secure/custom/SampleWebSecureCustomApplicationTests.java index 263169a389..e1b876faf4 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure-custom/src/test/java/sample/ui/secure/SampleWebSecureCustomApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-web-secure-custom/src/test/java/sample/web/secure/custom/SampleWebSecureCustomApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package sample.ui.secure; +package sample.web.secure.custom; import java.util.Arrays; import java.util.regex.Matcher; diff --git a/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java b/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java index 2f62605398..abdcb2bb51 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -22,11 +22,10 @@ import java.util.Map; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; import org.springframework.core.annotation.Order; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; @@ -36,8 +35,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication @Controller public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter { diff --git a/spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java b/spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java index 04dc6abb10..12b2b47f10 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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,10 +19,9 @@ package sample.web.secure; import java.util.Date; import java.util.Map; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; @@ -33,8 +32,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication @Controller public class SampleWebSecureApplication extends WebMvcConfigurerAdapter { diff --git a/spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/webstatic/SampleWebStaticApplicationTests.java b/spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/web/staticcontent/SampleWebStaticApplicationTests.java similarity index 96% rename from spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/webstatic/SampleWebStaticApplicationTests.java rename to spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/web/staticcontent/SampleWebStaticApplicationTests.java index dd1285fe27..994775a089 100644 --- a/spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/webstatic/SampleWebStaticApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-web-static/src/test/java/sample/web/staticcontent/SampleWebStaticApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package sample.webstatic; +package sample.web.staticcontent; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/MessageControllerWebTests.java b/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/web/ui/MessageControllerWebTests.java similarity index 97% rename from spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/MessageControllerWebTests.java rename to spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/web/ui/MessageControllerWebTests.java index 3a4675ba14..9c14e9b972 100644 --- a/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/MessageControllerWebTests.java +++ b/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/web/ui/MessageControllerWebTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package sample.ui; +package sample.web.ui; import java.util.regex.Pattern; diff --git a/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/SampleWebUiApplicationTests.java b/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/web/ui/SampleWebUiApplicationTests.java similarity index 97% rename from spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/SampleWebUiApplicationTests.java rename to spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/web/ui/SampleWebUiApplicationTests.java index b24c4eb3b3..ed0495eaae 100644 --- a/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/ui/SampleWebUiApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/web/ui/SampleWebUiApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package sample.ui; +package sample.web.ui; import java.net.URI;