How can i combine Guice and Mapstruct?
问题 I'm using jersey and Guice DI and I want to use Mapstruct interfaces with @Inject annotation. So is there some way to force Guice to autowire Mapstruct interface implementations ? 回答1: You can configure the implementations of the Mappers to be annotated with JSR 330 annotation by using @Mapper(componentModel = "jsr330") . You can find more information in the reference documentation. You can then bind the Mapper interface with the implementation class in your modules. One way to bind them is