diff --git a/spring-boot-samples/spring-boot-sample-actuator-log4j/src/main/java/sample/actuator/log4j/SampleActuatorLog4JApplication.java b/spring-boot-samples/spring-boot-sample-actuator-log4j/src/main/java/sample/actuator/log4j/SampleActuatorLog4JApplication.java index d75731aceb..66c1edc98b 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-log4j/src/main/java/sample/actuator/log4j/SampleActuatorLog4JApplication.java +++ b/spring-boot-samples/spring-boot-sample-actuator-log4j/src/main/java/sample/actuator/log4j/SampleActuatorLog4JApplication.java @@ -17,15 +17,9 @@ package sample.actuator.log4j; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.SpringBootApplication; -@Configuration -@EnableAutoConfiguration -@EnableConfigurationProperties -@ComponentScan +@SpringBootApplication public class SampleActuatorLog4JApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-actuator-log4j2/src/main/java/sample/actuator/log4j2/SampleActuatorLog4J2Application.java b/spring-boot-samples/spring-boot-sample-actuator-log4j2/src/main/java/sample/actuator/log4j2/SampleActuatorLog4J2Application.java index a7b840a4d2..84faa97ddf 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-log4j2/src/main/java/sample/actuator/log4j2/SampleActuatorLog4J2Application.java +++ b/spring-boot-samples/spring-boot-sample-actuator-log4j2/src/main/java/sample/actuator/log4j2/SampleActuatorLog4J2Application.java @@ -17,15 +17,9 @@ package sample.actuator.log4j2; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.SpringBootApplication; -@Configuration -@EnableAutoConfiguration -@EnableConfigurationProperties -@ComponentScan +@SpringBootApplication public class SampleActuatorLog4J2Application { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-actuator-noweb/src/main/java/sample/actuator/SampleActuatorNoWebApplication.java b/spring-boot-samples/spring-boot-sample-actuator-noweb/src/main/java/sample/actuator/SampleActuatorNoWebApplication.java index 79903b28f9..edfdff8ed7 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-noweb/src/main/java/sample/actuator/SampleActuatorNoWebApplication.java +++ b/spring-boot-samples/spring-boot-sample-actuator-noweb/src/main/java/sample/actuator/SampleActuatorNoWebApplication.java @@ -17,15 +17,9 @@ package sample.actuator; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.SpringBootApplication; -@Configuration -@EnableAutoConfiguration -@EnableConfigurationProperties -@ComponentScan +@SpringBootApplication public class SampleActuatorNoWebApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleActuatorApplication.java b/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleActuatorApplication.java index 10f8309a37..9623ad4f07 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleActuatorApplication.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/main/java/sample/actuator/SampleActuatorApplication.java @@ -19,15 +19,9 @@ package sample.actuator; import org.springframework.boot.SpringApplication; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.SpringBootApplication; -@Configuration -@EnableAutoConfiguration -@EnableConfigurationProperties -@ComponentScan +@SpringBootApplication public class SampleActuatorApplication implements HealthIndicator { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-amqp/src/main/java/sample/amqp/SampleAmqpSimpleApplication.java b/spring-boot-samples/spring-boot-sample-amqp/src/main/java/sample/amqp/SampleAmqpSimpleApplication.java index a11777ef0d..ebd8432fca 100644 --- a/spring-boot-samples/spring-boot-sample-amqp/src/main/java/sample/amqp/SampleAmqpSimpleApplication.java +++ b/spring-boot-samples/spring-boot-sample-amqp/src/main/java/sample/amqp/SampleAmqpSimpleApplication.java @@ -22,13 +22,11 @@ import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; import org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor; -@Configuration -@EnableAutoConfiguration +@SpringBootApplication public class SampleAmqpSimpleApplication { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-aop/src/main/java/sample/aop/SampleAopApplication.java b/spring-boot-samples/spring-boot-sample-aop/src/main/java/sample/aop/SampleAopApplication.java index 349183b21c..d4678c0338 100644 --- a/spring-boot-samples/spring-boot-sample-aop/src/main/java/sample/aop/SampleAopApplication.java +++ b/spring-boot-samples/spring-boot-sample-aop/src/main/java/sample/aop/SampleAopApplication.java @@ -19,15 +19,11 @@ package sample.aop; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; 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; import sample.aop.service.HelloWorldService; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleAopApplication implements CommandLineRunner { // Simple example shows how an application can spy on itself with AOP diff --git a/spring-boot-samples/spring-boot-sample-batch/src/main/java/sample/batch/SampleBatchApplication.java b/spring-boot-samples/spring-boot-sample-batch/src/main/java/sample/batch/SampleBatchApplication.java index d83e508159..ca0394a5be 100644 --- a/spring-boot-samples/spring-boot-sample-batch/src/main/java/sample/batch/SampleBatchApplication.java +++ b/spring-boot-samples/spring-boot-sample-batch/src/main/java/sample/batch/SampleBatchApplication.java @@ -27,14 +27,10 @@ import org.springframework.batch.core.step.tasklet.Tasklet; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication @EnableBatchProcessing public class SampleBatchApplication { diff --git a/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/main/java/sample/data/elasticsearch/SampleElasticsearchApplication.java b/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/main/java/sample/data/elasticsearch/SampleElasticsearchApplication.java index 6cae86904f..969d0b7525 100644 --- a/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/main/java/sample/data/elasticsearch/SampleElasticsearchApplication.java +++ b/spring-boot-samples/spring-boot-sample-data-elasticsearch/src/main/java/sample/data/elasticsearch/SampleElasticsearchApplication.java @@ -19,13 +19,9 @@ package sample.data.elasticsearch; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; 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 SampleElasticsearchApplication implements CommandLineRunner { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java b/spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java index de5d1c79a0..547b382c53 100644 --- a/spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java +++ b/spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java @@ -17,9 +17,7 @@ package sample.data.gemfire; 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; import org.springframework.context.annotation.ImportResource; import org.springframework.data.gemfire.repository.config.EnableGemfireRepositories; import org.springframework.transaction.annotation.EnableTransactionManagement; @@ -31,10 +29,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; * * @author John Blum */ -@Configuration +@SpringBootApplication @ImportResource("/spring-data-gemfire-cache.xml") -@ComponentScan -@EnableAutoConfiguration @EnableGemfireRepositories @EnableTransactionManagement public class SampleDataGemFireApplication { diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/SampleDataJpaApplication.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/SampleDataJpaApplication.java index 50bf0d3133..09f78ef34a 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/SampleDataJpaApplication.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/SampleDataJpaApplication.java @@ -17,13 +17,9 @@ package sample.data.jpa; 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 -@ComponentScan -@EnableAutoConfiguration +@SpringBootApplication public class SampleDataJpaApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/sample/data/mongo/SampleMongoApplication.java b/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/sample/data/mongo/SampleMongoApplication.java index eaae22f90d..e99dde17db 100644 --- a/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/sample/data/mongo/SampleMongoApplication.java +++ b/spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/sample/data/mongo/SampleMongoApplication.java @@ -19,13 +19,9 @@ package sample.data.mongo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; 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 SampleMongoApplication implements CommandLineRunner { @Autowired @@ -34,16 +30,16 @@ public class SampleMongoApplication implements CommandLineRunner { @Override public void run(String... args) throws Exception { - repository.deleteAll(); + this.repository.deleteAll(); // save a couple of customers - repository.save(new Customer("Alice", "Smith")); - repository.save(new Customer("Bob", "Smith")); + this.repository.save(new Customer("Alice", "Smith")); + this.repository.save(new Customer("Bob", "Smith")); // fetch all customers System.out.println("Customers found with findAll():"); System.out.println("-------------------------------"); - for (Customer customer : repository.findAll()) { + for (Customer customer : this.repository.findAll()) { System.out.println(customer); } System.out.println(); @@ -51,11 +47,11 @@ public class SampleMongoApplication implements CommandLineRunner { // fetch an individual customer System.out.println("Customer found with findByFirstName('Alice'):"); System.out.println("--------------------------------"); - System.out.println(repository.findByFirstName("Alice")); + System.out.println(this.repository.findByFirstName("Alice")); System.out.println("Customers found with findByLastName('Smith'):"); System.out.println("--------------------------------"); - for (Customer customer : repository.findByLastName("Smith")) { + for (Customer customer : this.repository.findByLastName("Smith")) { System.out.println(customer); } diff --git a/spring-boot-samples/spring-boot-sample-data-redis/src/main/java/sample/data/redis/SampleRedisApplication.java b/spring-boot-samples/spring-boot-sample-data-redis/src/main/java/sample/data/redis/SampleRedisApplication.java index f8daf3e5a5..cf8d7b5164 100644 --- a/spring-boot-samples/spring-boot-sample-data-redis/src/main/java/sample/data/redis/SampleRedisApplication.java +++ b/spring-boot-samples/spring-boot-sample-data-redis/src/main/java/sample/data/redis/SampleRedisApplication.java @@ -19,13 +19,11 @@ package sample.data.redis; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; -@Configuration -@EnableAutoConfiguration +@SpringBootApplication public class SampleRedisApplication implements CommandLineRunner { @Autowired @@ -33,9 +31,9 @@ public class SampleRedisApplication implements CommandLineRunner { @Override public void run(String... args) throws Exception { - ValueOperations ops = template.opsForValue(); + ValueOperations ops = this.template.opsForValue(); String key = "spring.boot.redis.test"; - if (!template.hasKey(key)) { + if (!this.template.hasKey(key)) { ops.set(key, "foo"); } System.out.println("Found key " + key + ", value=" + ops.get(key)); diff --git a/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/jpa/SampleDataRestApplication.java b/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/jpa/SampleDataRestApplication.java index a3fa49daa9..9cd28fa353 100644 --- a/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/jpa/SampleDataRestApplication.java +++ b/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/jpa/SampleDataRestApplication.java @@ -17,13 +17,9 @@ package sample.data.jpa; 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 -@ComponentScan -@EnableAutoConfiguration +@SpringBootApplication public class SampleDataRestApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-data-solr/src/main/java/sample/data/solr/SampleSolrApplication.java b/spring-boot-samples/spring-boot-sample-data-solr/src/main/java/sample/data/solr/SampleSolrApplication.java index 1cd4eea8c4..2944a3fd77 100644 --- a/spring-boot-samples/spring-boot-sample-data-solr/src/main/java/sample/data/solr/SampleSolrApplication.java +++ b/spring-boot-samples/spring-boot-sample-data-solr/src/main/java/sample/data/solr/SampleSolrApplication.java @@ -19,13 +19,9 @@ package sample.data.solr; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; 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 SampleSolrApplication implements CommandLineRunner { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/SampleFlywayApplication.java b/spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/SampleFlywayApplication.java index 4e027203ef..4505921b6d 100644 --- a/spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/SampleFlywayApplication.java +++ b/spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/SampleFlywayApplication.java @@ -23,15 +23,11 @@ import javax.persistence.Id; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; 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; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; -@Configuration -@ComponentScan -@EnableAutoConfiguration +@SpringBootApplication public class SampleFlywayApplication implements CommandLineRunner { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-hornetq/src/main/java/sample/hornetq/SampleHornetQApplication.java b/spring-boot-samples/spring-boot-sample-hornetq/src/main/java/sample/hornetq/SampleHornetQApplication.java index b73a8626ca..b3fb7a4c3f 100644 --- a/spring-boot-samples/spring-boot-sample-hornetq/src/main/java/sample/hornetq/SampleHornetQApplication.java +++ b/spring-boot-samples/spring-boot-sample-hornetq/src/main/java/sample/hornetq/SampleHornetQApplication.java @@ -23,16 +23,12 @@ import javax.jms.MessageListener; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; import org.springframework.jms.listener.DefaultMessageListenerContainer; import org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleHornetQApplication { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-integration/src/main/java/sample/integration/SampleIntegrationApplication.java b/spring-boot-samples/spring-boot-sample-integration/src/main/java/sample/integration/SampleIntegrationApplication.java index f995ca63c5..96fec47923 100644 --- a/spring-boot-samples/spring-boot-sample-integration/src/main/java/sample/integration/SampleIntegrationApplication.java +++ b/spring-boot-samples/spring-boot-sample-integration/src/main/java/sample/integration/SampleIntegrationApplication.java @@ -17,16 +17,12 @@ package sample.integration; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; -@Configuration -@EnableAutoConfiguration +@SpringBootApplication @EnableConfigurationProperties(ServiceProperties.class) -@ComponentScan @ImportResource("integration-context.xml") public class SampleIntegrationApplication { diff --git a/spring-boot-samples/spring-boot-sample-jersey/src/main/java/sample/jersey/SampleJerseyApplication.java b/spring-boot-samples/spring-boot-sample-jersey/src/main/java/sample/jersey/SampleJerseyApplication.java index e96c67bbc8..ee8213c9e9 100644 --- a/spring-boot-samples/spring-boot-sample-jersey/src/main/java/sample/jersey/SampleJerseyApplication.java +++ b/spring-boot-samples/spring-boot-sample-jersey/src/main/java/sample/jersey/SampleJerseyApplication.java @@ -16,13 +16,11 @@ package sample.jersey; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.web.SpringBootServletInitializer; -import org.springframework.context.annotation.ComponentScan; -@ComponentScan -@EnableAutoConfiguration +@SpringBootApplication public class SampleJerseyApplication extends SpringBootServletInitializer { @Override diff --git a/spring-boot-samples/spring-boot-sample-jersey1/src/main/java/sample/jersey1/SampleJersey1Application.java b/spring-boot-samples/spring-boot-sample-jersey1/src/main/java/sample/jersey1/SampleJersey1Application.java index 4dccc77529..0e7565dc43 100644 --- a/spring-boot-samples/spring-boot-sample-jersey1/src/main/java/sample/jersey1/SampleJersey1Application.java +++ b/spring-boot-samples/spring-boot-sample-jersey1/src/main/java/sample/jersey1/SampleJersey1Application.java @@ -20,19 +20,15 @@ import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.embedded.FilterRegistrationBean; import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; import com.sun.jersey.spi.container.servlet.ServletContainer; -@Configuration -@ComponentScan -@EnableAutoConfiguration +@SpringBootApplication @Path("/") public class SampleJersey1Application { diff --git a/spring-boot-samples/spring-boot-sample-jetty/src/main/java/sample/jetty/SampleJettyApplication.java b/spring-boot-samples/spring-boot-sample-jetty/src/main/java/sample/jetty/SampleJettyApplication.java index 2f7aee959e..242a14256a 100644 --- a/spring-boot-samples/spring-boot-sample-jetty/src/main/java/sample/jetty/SampleJettyApplication.java +++ b/spring-boot-samples/spring-boot-sample-jetty/src/main/java/sample/jetty/SampleJettyApplication.java @@ -17,13 +17,9 @@ package sample.jetty; 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 SampleJettyApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-jetty8/src/main/java/sample/jetty/SampleJetty8Application.java b/spring-boot-samples/spring-boot-sample-jetty8/src/main/java/sample/jetty/SampleJetty8Application.java index 5ab619eb31..9316f02f97 100644 --- a/spring-boot-samples/spring-boot-sample-jetty8/src/main/java/sample/jetty/SampleJetty8Application.java +++ b/spring-boot-samples/spring-boot-sample-jetty8/src/main/java/sample/jetty/SampleJetty8Application.java @@ -17,13 +17,9 @@ package sample.jetty; 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 SampleJetty8Application { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-jta-atomikos/src/main/java/sample/atomikos/SampleAtomikosApplication.java b/spring-boot-samples/spring-boot-sample-jta-atomikos/src/main/java/sample/atomikos/SampleAtomikosApplication.java index e0094a3e4a..801bc9ec36 100644 --- a/spring-boot-samples/spring-boot-sample-jta-atomikos/src/main/java/sample/atomikos/SampleAtomikosApplication.java +++ b/spring-boot-samples/spring-boot-sample-jta-atomikos/src/main/java/sample/atomikos/SampleAtomikosApplication.java @@ -19,14 +19,10 @@ package sample.atomikos; import java.io.Closeable; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -@Configuration -@ComponentScan -@EnableAutoConfiguration +@SpringBootApplication public class SampleAtomikosApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-jta-bitronix/src/main/java/sample/bitronix/SampleBitronixApplication.java b/spring-boot-samples/spring-boot-sample-jta-bitronix/src/main/java/sample/bitronix/SampleBitronixApplication.java index 62fb930224..edfa4c8a09 100644 --- a/spring-boot-samples/spring-boot-sample-jta-bitronix/src/main/java/sample/bitronix/SampleBitronixApplication.java +++ b/spring-boot-samples/spring-boot-sample-jta-bitronix/src/main/java/sample/bitronix/SampleBitronixApplication.java @@ -19,14 +19,10 @@ package sample.bitronix; import java.io.Closeable; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -@Configuration -@ComponentScan -@EnableAutoConfiguration +@SpringBootApplication public class SampleBitronixApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-jta-jndi/src/main/java/sample/jndi/SampleJndiApplication.java b/spring-boot-samples/spring-boot-sample-jta-jndi/src/main/java/sample/jndi/SampleJndiApplication.java index 2f42628517..d8ff36e888 100644 --- a/spring-boot-samples/spring-boot-sample-jta-jndi/src/main/java/sample/jndi/SampleJndiApplication.java +++ b/spring-boot-samples/spring-boot-sample-jta-jndi/src/main/java/sample/jndi/SampleJndiApplication.java @@ -16,13 +16,9 @@ package sample.jndi; -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 SampleJndiApplication { } diff --git a/spring-boot-samples/spring-boot-sample-liquibase/src/main/java/sample/liquibase/SampleLiquibaseApplication.java b/spring-boot-samples/spring-boot-sample-liquibase/src/main/java/sample/liquibase/SampleLiquibaseApplication.java index 155021359c..22607d7b18 100644 --- a/spring-boot-samples/spring-boot-sample-liquibase/src/main/java/sample/liquibase/SampleLiquibaseApplication.java +++ b/spring-boot-samples/spring-boot-sample-liquibase/src/main/java/sample/liquibase/SampleLiquibaseApplication.java @@ -17,13 +17,9 @@ package sample.liquibase; 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 -@ComponentScan -@EnableAutoConfiguration +@SpringBootApplication public class SampleLiquibaseApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java b/spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java index b117adce2b..a2e6db6708 100644 --- a/spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java +++ b/spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java @@ -17,16 +17,13 @@ package sample.parent; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; -@Configuration -@EnableAutoConfiguration +@SpringBootApplication @EnableConfigurationProperties(ServiceProperties.class) -@ComponentScan public class SampleParentContextApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-profile/src/main/java/sample/profile/SampleProfileApplication.java b/spring-boot-samples/spring-boot-sample-profile/src/main/java/sample/profile/SampleProfileApplication.java index 8140c05166..04ab569a58 100644 --- a/spring-boot-samples/spring-boot-sample-profile/src/main/java/sample/profile/SampleProfileApplication.java +++ b/spring-boot-samples/spring-boot-sample-profile/src/main/java/sample/profile/SampleProfileApplication.java @@ -19,15 +19,11 @@ package sample.profile; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; 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; import sample.profile.service.MessageService; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleProfileApplication implements CommandLineRunner { // Simple example shows how a command line spring application can execute an diff --git a/spring-boot-samples/spring-boot-sample-simple/src/main/java/sample/simple/SampleSimpleApplication.java b/spring-boot-samples/spring-boot-sample-simple/src/main/java/sample/simple/SampleSimpleApplication.java index 830f95f15a..80604eba8d 100644 --- a/spring-boot-samples/spring-boot-sample-simple/src/main/java/sample/simple/SampleSimpleApplication.java +++ b/spring-boot-samples/spring-boot-sample-simple/src/main/java/sample/simple/SampleSimpleApplication.java @@ -19,15 +19,11 @@ package sample.simple; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; 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; import sample.simple.service.HelloWorldService; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleSimpleApplication implements CommandLineRunner { // Simple example shows how a command line spring application can execute an diff --git a/spring-boot-samples/spring-boot-sample-tomcat-jsp/src/main/java/sample/jsp/SampleTomcatJspApplication.java b/spring-boot-samples/spring-boot-sample-tomcat-jsp/src/main/java/sample/jsp/SampleTomcatJspApplication.java index 749edab820..ee530d7045 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat-jsp/src/main/java/sample/jsp/SampleTomcatJspApplication.java +++ b/spring-boot-samples/spring-boot-sample-tomcat-jsp/src/main/java/sample/jsp/SampleTomcatJspApplication.java @@ -17,15 +17,11 @@ package sample.jsp; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.web.SpringBootServletInitializer; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleTomcatJspApplication extends SpringBootServletInitializer { @Override diff --git a/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/main/java/sample/tomcat/SampleTomcatTwoConnectorsApplication.java b/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/main/java/sample/tomcat/SampleTomcatTwoConnectorsApplication.java index c4f1f9c0dd..68f5704627 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/main/java/sample/tomcat/SampleTomcatTwoConnectorsApplication.java +++ b/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/main/java/sample/tomcat/SampleTomcatTwoConnectorsApplication.java @@ -23,12 +23,10 @@ import java.io.IOException; import org.apache.catalina.connector.Connector; import org.apache.coyote.http11.Http11NioProtocol; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; import org.springframework.util.FileCopyUtils; import org.springframework.util.SocketUtils; @@ -38,9 +36,7 @@ import org.springframework.util.SocketUtils; * * @author Brock Mills */ -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleTomcatTwoConnectorsApplication { @Bean diff --git a/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/main/java/sample/tomcat/SampleTomcatSslApplication.java b/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/main/java/sample/tomcat/SampleTomcatSslApplication.java index d6b6abce3e..2d8f666c25 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/main/java/sample/tomcat/SampleTomcatSslApplication.java +++ b/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/main/java/sample/tomcat/SampleTomcatSslApplication.java @@ -17,15 +17,9 @@ package sample.tomcat; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; +import org.springframework.boot.autoconfigure.SpringBootApplication; -@ComponentScan -@Configuration -@EnableAutoConfiguration -@EnableConfigurationProperties +@SpringBootApplication public class SampleTomcatSslApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/SampleTomcatApplication.java b/spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/SampleTomcatApplication.java index 1cbb89bff3..9c681a51a4 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/SampleTomcatApplication.java +++ b/spring-boot-samples/spring-boot-sample-tomcat/src/main/java/sample/tomcat/SampleTomcatApplication.java @@ -22,14 +22,10 @@ import javax.servlet.ServletContextListener; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleTomcatApplication { private static Log logger = LogFactory.getLog(SampleTomcatApplication.class); diff --git a/spring-boot-samples/spring-boot-sample-tomcat7-jsp/src/main/java/sample/jsp/SampleTomcat7JspApplication.java b/spring-boot-samples/spring-boot-sample-tomcat7-jsp/src/main/java/sample/jsp/SampleTomcat7JspApplication.java index a49af37a57..e51a0d0675 100644 --- a/spring-boot-samples/spring-boot-sample-tomcat7-jsp/src/main/java/sample/jsp/SampleTomcat7JspApplication.java +++ b/spring-boot-samples/spring-boot-sample-tomcat7-jsp/src/main/java/sample/jsp/SampleTomcat7JspApplication.java @@ -17,15 +17,11 @@ package sample.jsp; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.web.SpringBootServletInitializer; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleTomcat7JspApplication extends SpringBootServletInitializer { @Override diff --git a/spring-boot-samples/spring-boot-sample-traditional/src/main/java/sample/traditional/SampleTraditionalApplication.java b/spring-boot-samples/spring-boot-sample-traditional/src/main/java/sample/traditional/SampleTraditionalApplication.java index cb7928cc74..098caac83c 100644 --- a/spring-boot-samples/spring-boot-sample-traditional/src/main/java/sample/traditional/SampleTraditionalApplication.java +++ b/spring-boot-samples/spring-boot-sample-traditional/src/main/java/sample/traditional/SampleTraditionalApplication.java @@ -17,13 +17,9 @@ package sample.traditional; 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 SampleTraditionalApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-velocity/src/main/java/sample/velocity/SampleVelocityApplication.java b/spring-boot-samples/spring-boot-sample-velocity/src/main/java/sample/velocity/SampleVelocityApplication.java index 497825838b..64907da70a 100644 --- a/spring-boot-samples/spring-boot-sample-velocity/src/main/java/sample/velocity/SampleVelocityApplication.java +++ b/spring-boot-samples/spring-boot-sample-velocity/src/main/java/sample/velocity/SampleVelocityApplication.java @@ -25,14 +25,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.CommandLineRunner; 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; import org.springframework.ui.velocity.VelocityEngineUtils; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleVelocityApplication implements CommandLineRunner { @Value("${application.message}") diff --git a/spring-boot-samples/spring-boot-sample-web-freemarker/src/main/java/sample/freemarker/SampleWebFreeMarkerApplication.java b/spring-boot-samples/spring-boot-sample-web-freemarker/src/main/java/sample/freemarker/SampleWebFreeMarkerApplication.java index 955aadbc93..8bfd965bd2 100644 --- a/spring-boot-samples/spring-boot-sample-web-freemarker/src/main/java/sample/freemarker/SampleWebFreeMarkerApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-freemarker/src/main/java/sample/freemarker/SampleWebFreeMarkerApplication.java @@ -17,13 +17,9 @@ package sample.freemarker; 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 SampleWebFreeMarkerApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-web-groovy-templates/src/main/java/sample/ui/SampleGroovyTemplateApplication.java b/spring-boot-samples/spring-boot-sample-web-groovy-templates/src/main/java/sample/ui/SampleGroovyTemplateApplication.java index 45daa1b6eb..6fb1683fb3 100644 --- a/spring-boot-samples/spring-boot-sample-web-groovy-templates/src/main/java/sample/ui/SampleGroovyTemplateApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-groovy-templates/src/main/java/sample/ui/SampleGroovyTemplateApplication.java @@ -17,15 +17,11 @@ package sample.ui; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.converter.Converter; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleGroovyTemplateApplication { @Bean diff --git a/spring-boot-samples/spring-boot-sample-web-jsp/src/main/java/sample/jsp/SampleWebJspApplication.java b/spring-boot-samples/spring-boot-sample-web-jsp/src/main/java/sample/jsp/SampleWebJspApplication.java index 1775fd0e45..6fe4742263 100644 --- a/spring-boot-samples/spring-boot-sample-web-jsp/src/main/java/sample/jsp/SampleWebJspApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-jsp/src/main/java/sample/jsp/SampleWebJspApplication.java @@ -17,15 +17,11 @@ package sample.jsp; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.web.SpringBootServletInitializer; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleWebJspApplication extends SpringBootServletInitializer { @Override diff --git a/spring-boot-samples/spring-boot-sample-web-static/src/main/java/sample/ui/SampleWebStaticApplication.java b/spring-boot-samples/spring-boot-sample-web-static/src/main/java/sample/ui/SampleWebStaticApplication.java index 227853dde4..9348477e69 100644 --- a/spring-boot-samples/spring-boot-sample-web-static/src/main/java/sample/ui/SampleWebStaticApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-static/src/main/java/sample/ui/SampleWebStaticApplication.java @@ -17,13 +17,11 @@ package sample.ui; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.web.SpringBootServletInitializer; -import org.springframework.context.annotation.Configuration; -@Configuration -@EnableAutoConfiguration +@SpringBootApplication public class SampleWebStaticApplication extends SpringBootServletInitializer { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/SampleWebUiApplication.java b/spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/SampleWebUiApplication.java index dc00e09976..46bebc61da 100644 --- a/spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/SampleWebUiApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/ui/SampleWebUiApplication.java @@ -17,15 +17,11 @@ package sample.ui; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; import org.springframework.core.convert.converter.Converter; -@Configuration -@EnableAutoConfiguration -@ComponentScan +@SpringBootApplication public class SampleWebUiApplication { @Bean diff --git a/spring-boot-samples/spring-boot-sample-web-velocity/src/main/java/sample/velocity/SampleWebVelocityApplication.java b/spring-boot-samples/spring-boot-sample-web-velocity/src/main/java/sample/velocity/SampleWebVelocityApplication.java index 3c51c49cc0..ecb35c9612 100644 --- a/spring-boot-samples/spring-boot-sample-web-velocity/src/main/java/sample/velocity/SampleWebVelocityApplication.java +++ b/spring-boot-samples/spring-boot-sample-web-velocity/src/main/java/sample/velocity/SampleWebVelocityApplication.java @@ -17,13 +17,9 @@ package sample.velocity; 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 SampleWebVelocityApplication { public static void main(String[] args) throws Exception { diff --git a/spring-boot-samples/spring-boot-sample-websocket/src/main/java/samples/websocket/config/SampleWebSocketsApplication.java b/spring-boot-samples/spring-boot-sample-websocket/src/main/java/samples/websocket/config/SampleWebSocketsApplication.java index 8d84d2fcd2..1313c3d1fa 100644 --- a/spring-boot-samples/spring-boot-sample-websocket/src/main/java/samples/websocket/config/SampleWebSocketsApplication.java +++ b/spring-boot-samples/spring-boot-sample-websocket/src/main/java/samples/websocket/config/SampleWebSocketsApplication.java @@ -17,11 +17,10 @@ package samples.websocket.config; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; 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; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.config.annotation.WebSocketConfigurer; @@ -35,8 +34,7 @@ import samples.websocket.echo.EchoService; import samples.websocket.echo.EchoWebSocketHandler; import samples.websocket.snake.SnakeWebSocketHandler; -@Configuration -@EnableAutoConfiguration +@SpringBootApplication @EnableWebSocket public class SampleWebSocketsApplication extends SpringBootServletInitializer implements WebSocketConfigurer { diff --git a/spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/SampleWsApplication.java b/spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/SampleWsApplication.java index 3881d4ccd0..3e86036dfe 100644 --- a/spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/SampleWsApplication.java +++ b/spring-boot-samples/spring-boot-sample-ws/src/main/java/sample/ws/SampleWsApplication.java @@ -17,13 +17,9 @@ package sample.ws; 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 SampleWsApplication { public static void main(String[] args) throws Exception {