외부 라이브러리 Bean 등록

1
2
3
4
5
6
7
@Component
public class Test {
    @Bean
    public Library  getLibrary (){
        return new Library();
    }
}

외부 클래스에는 Component를 지정해 줄수 없기 때문에 Bean을 사용하여 등록한다.

빈생성은 @Component로도 가능한데 외부 라이브러리는 직접 수정하여 @Component를 넣어줄수없다.