title: Mapstruct dependency injection using componentModel = "spring" gives null object
body: <p>I am trying to inject a mapper object (class is TypeMapper) dependency using Spring as follows,</p>
  
  <pre><code>@Mapper(componentModel = "spring",
          uses = {TypeMapper.class})
  public interface AttachmentMapper {
  
    AttachmentMapper MAPPER = Mappers.getMapper(AttachmentMapper.class);
  
    @Mappings({
        @Mapping(source = "type", target = "type") })
    AttachmentDTO toDTO(Attachment attachment);
  }
  </code></pre>
  
  <p>Code for TypeMapper is as follows,</p>
  
  <pre><code>@Component
  @Mapper
  public abstract class TypeMapper {
  
    public abstract Type mapType(DtoType DtoType);
  
    @InheritConfiguration(name = "mapType")
    public abstract DtoType mapDtoType(Type type);
  }
  </code></pre>
  
  <p>The generated <code>AttachmentMapperImpl</code> code is follows,</p>
  
  <pre><code>public class AttachmentMapperImpl implements AttachmentMapper {
  
      @Autowired
  
      private TypeMapper typeMapper;
  
      public AttachmentDto toDTO(Attachment attachment) {
  
      if ( attachment == null) {
          return null;
      }
  
      attachmentDTO.setType(typeMapper.mapDtoType(attachment.getType()));
  
      return attachmentDTO;
  }
  
  </code></pre>
  
  <p>The issue is in the generated code, the <code>@Autowired typeMapper</code> is null. Can anyone shed some light on what I am doing wrong here? </p>