0

In my current project I'm always getting compilation errors like Unknown property "xxx" in result type "yyy". Did you mean "zzz"? I already walked through this post, checked the Mapstruct documentation, compared my code with this example and read lots of other posts, which all did not help.

Using the following entries in the build.gradle

project.ext {
  sdaseVersion = '2.53.1'
  lombokVersion = '1.18.24'
  mapStructVersion = '1.4.2.Final'
  lombokMapStructBindingVersion = '0.2.0'
}

dependencies {
  …

  implementation "org.mapstruct:mapstruct:${mapStructVersion}"
  compileOnly "org.projectlombok:lombok:${lombokVersion}"

  annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
  annotationProcessor "org.mapstruct:mapstruct-processor:${mapStructVersion}"
  annotationProcessor  "org.projectlombok:lombok-mapstruct-binding:${lombokMapStructBindingVersion}"
}

... my code compiles and runs without any issues (note it's 1.4.2.Final here). Once I increase the version to 1.5.2.Final I'm getting the erros as written above. I tried also to exchange the order of annotation processors, reloaded my project and invalidated my cache without success.

Does anyone have an idea how to fix this?

Trinimon
  • 13,839
  • 9
  • 44
  • 60
  • I just tried the same with my project (lifting mapstruct to 1.5.2.Final), and that still compiles fine. Could you give some details on the code that causes the errors? – Jan Rieke Jul 14 '22 at 06:15
  • Meanwhile I saw that the issue could be related to this one documented at github: https://github.com/mapstruct/mapstruct/issues/2743. It seems like Mapstruct 1.5.2 handles the annotation `ignoreUnmappedSourceProperties` somewhat differently. I'd like to keep using `ReportingPolicy.ERROR`, because I think it's beneficial and so I have to define the source fields to ignore. – Trinimon Jul 14 '22 at 12:21

0 Answers0