package com.hantsylabs.example.spring.config; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.RestController; @Configuration @ComponentScan( basePackages= {"com.hantsylabs.example.spring"}, excludeFilters = { @Filter( type = FilterType.ANNOTATION, value = { RestController.class, ControllerAdvice.class, Configuration.class } ) } ) public class AppConfig { }