Hi,
I'm new to MapStruct and like it so much, it's amazing to handle dto mapping.
Now i want to put my mapper into a custom dependency, e.g. Human.jar, then import into my different Spring microservices. And it throws the exception
No found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.
i've found some related questions but they're putting the mapper and service under the same project resource, which is not my case.
Please advise if there is a way can achieve it.
Thank you!
Human.jar
@Mapper(componentModel = "spring", uses = {})
public abstract class HumanMapper {
public abstract HumanDTO toDto(Human human);
}
Spring microservice Human
@ComponentScan(basePackages = {"com.human.mapper"})
@SpringBootApplication
public class SpringMsHumanApp implements InitializingBean {
@Autowired
private HumanMapper humanMapper;
}