JSpecify nullness support, configurable mapper accessibility, and much more: MapStruct 1.7.0.Beta2 is out

It’s my pleasure to announce the second Beta release of MapStruct 1.7.

The new release comes with some new functionality and many quality of life improvements to the generated code, e.g.:

  • JSpecify nullness annotation support
  • Configurable accessibility for the generated mapper class
  • Built-in conversion between URI and String
  • Modernized generated code (switch expressions for value mappings, diamond operator, multi-catch)
Read more...

News

MapStruct Spring Extensions 2.0.0 released

It is my pleasure to announce the next official release of MapStruct Spring Extensions. What started out as a StackOverflow question turned into its own (sub-)project within the MapStruct organization.

Changes in this release:

  • The minimum requirements for applying these extensions are now Java 17 and Spring 6.
  • Exclusive use of jakarta.annotation.PostConstruct instead of having a default option of the legacy javax.annotation.PostConstruct.

Including the annotations and extensions defined in this project will generate a class acting as bridge between MapStruct’s conventions and Spring' s ConversionService API that in turn can be added to any Mapper’s uses attribute. See the examples for details.

Read more...

MapStruct Spring Extensions 1.1.3 released

It is my pleasure to announce the next official release of MapStruct Spring Extensions. What started out as a StackOverflow question turned into its own (sub-)project within the MapStruct organization.

Changes in this release:

  • The change introduced in the previous release which stored TypeDescriptors as fields in the generated Adapter class caused rare issues with certain generic type definitions. Jesse Bonzo has thankfully provided a fix for this.
  • The modified converter scan led to errors when used with multiple SpringMapperConfigs in the same project, because it would generate several configurations with identical bean names. Thanks to simonovdenis, we have now got an option to configure the name for the generated configuration as well.

Including the annotations and extensions defined in this project will generate a class acting as bridge between MapStruct’s conventions and Spring' s ConversionService API that in turn can be added to any Mapper’s uses attribute. See the examples for details.

Read more...