The @JsonComponent beans are retrieved from the context at runtime:

https://github.com/spring-projects/spring-boot/blob/fcbc7dacf1a1d1156ffc0179dd90489271cc36b7/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponentModule.java#L79

This works. Each bean is then processed. As part of this processing, the declared classes are retrieved and, if they're of a supported type, an instance is created and registered:

https://github.com/spring-projects/spring-boot/blob/fcbc7dacf1a1d1156ffc0179dd90489271cc36b7/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponentModule.java#L103-L108

This does not work. The inner-classes of the @JsonComponent are silently ignored and json (de)serialization does not behave as expected due to their absence.