We are using mapstruct 1.3.1FINAL (in combination with lombok v1.18.4 if that matters) and the generated classes aren't compiling because the imports of the static methods used in expression mappings aren't generated. Any clues?
@Mapping(target = "value", expression = "java(ValueUtil.getValue(sourceValue))")
The generated code has compilation errors because the import of ValueUtil is missing :
request.setValue( ValueUtil.getValue(sourceValue) );
                Finally i got it, tried out what Sjaak wrote.
@Mapper(imports = { ValueUtil.class })
The import made it. Will try out if Deepaks answer works as well.
Please try with fully qualified class name for ValueUtil I.e. packagename.ValueUtil. This will provide the context to mapstruct to locate the class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With