there is a workaround that still uses MapStruct but avoids @AfterMapping or a full custom mapper implementation.
@Mapping(target = "id", expression = "java(context.getId())") Target sourceToTarget(Source source, @Context IdContext context);