79796836

Date: 2025-10-22 13:44:22
Score: 1
Natty:
Report link

It should be possible with @Qualifier e.g.: so

@Bean(autowireCandidate = false, defaultCandidate = false)
@Qualifier("myBean")
public MyBeanClass myBean() {
  return new MyBeanClass();
}

@Bean
public MyAnotherBean myAnotherBean(@Qualifier("myBean") MyBeanClass myBean) {
  return new MyAnotherBean(myBean);
}

You can find more information about @Qualifier here: https://docs.spring.io/spring-framework/reference/core/beans/annotation-config/autowired-qualifiers.html

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: FWidder