SpringBoot 1.2.0.RELEASE 부터 추가된 @SpringBootApplication.

/**
 * Indicates a {@link Configuration configuration} class that declares one or more
 * {@link Bean @Bean} methods and also triggers {@link EnableAutoConfiguration
 * auto-configuration} and {@link ComponentScan component scanning}. This is a convenience
 * annotation that is equivalent to declaring {@code @Configuration},
 * {@code @EnableAutoConfiguration} and {@code @ComponentScan}.
 *
 * @author Phillip Webb
 * @since 1.2.0
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Configuration
@EnableAutoConfiguration
@ComponentScan
public @interface SpringBootApplication {

}

1.1.9.RELEASE 까지는 Application Endpoint에 클래스에

@Configuration
@EnableAutoConfiguration
@ComponentScan
public class Application{
//...
}

3개 애노테이션을 사용해야했던 것을 하나로 줄여주었다.


+ Recent posts