Closed as not planned
Closed as not planned
Description
Affects: 6.0.2
Since #22154 , it seems not possible anymore to declare a Controller class via an @Bean
method.
Before we could do that:
@RequestMapping
class MyController {
}
@ConditionalOnSomething
@AutoConfiguration
class MyConfiguration {
@Bean
public MyController myController() {
return new MyController();
}
}
Now, because of
@Controller
.
But annotating it make it discoverable by component scan (enabled by the test classes for example), which prevents us from declaring the component conditionally.
Is there something I am missing here?