How can I access a Spring Bean inside my MapStruct Mapper?
What is the preferable way to access some Spring Service or another Bean inside of my MapStruct Mapper? (e.g. in the @AfterMapping
method)
8842 views
Note that MapStruct is not specific to Spring. It can also be used with CDI, Spring and JSR330. See the docs on dependency injection in the MapStruct Reference Manual and the
(edited)componentModel
configuration option. The question you are asking is relevant independently of the component model used.2