It has been four months since the release of the first final version of MapStruct. We’ve received a lot of great feedback and noticed a substantial increase of interest in the project. A couple of bugs were reported that we intend to fix with MapStruct 1.1 while also working on new features.
Today we release MapStruct 1.1.0.Beta1, containing fixes for most of the user-reported bugs. But we’ve also added some improvements and prepared for new features:
- The new annotation
@ValueMappingis introduced to be used for
enummappings. Previously, you would have used
@Mappingfor this, but we found a separate annotation makes things more clear and puts us in a better position for some upcoming features. The usage of
enummappings now triggers a deprecation warning and asks you to use
- The new annotation
@Namedis a predefined
@Qualifierthat can be used when creating a custom qualifier annotation seems too inconvenient.
- Handling of types with generically typed properties has been improved, so that you can now declare something like
SearchResult<VesselDto> vesselSearchResultToDto(SearchResult<Vessel> vessel).
- The preferred way of configuring the annotation processor in Maven projects has been updated to leverage the latest
annotationProcessorPathsoption, which makes the configuration a bit more smooth. Check the updated documentation.
The complete list of 24 closed issues can be found in the change log.
We plan the beta phase to be a short one, with a 1.1.0.CR1 release following in a couple of weeks.
In the mean time, you’re invited to try out the MapStruct Eclipse plug-in. Although it’s in an early stage, it already contains some handy content-assists (e.g. for
target property names in the
@Mapping annotation) and quick-fixes for some common mapping errors detected by MapStruct.
To fetch MapStruct 1.1.0.Beta1 via Maven, Gradle or similar dependency management tools, use the following GAV coordinates:
- org.mapstruct:mapstruct:1.1.0.Beta1 for the annotation JAR (to be used with Java <= 7) or org.mapstruct:mapstruct-jdk8:1.1.0.Beta1 (for usage with Java >= 8)
- org.mapstruct:mapstruct-processor:1.1.0.Beta1 for the annotation processor.
Alternatively, you can download distribution bundles (ZIP, TAR.GZ) from SourceForge.
- Get help at the mapstruct-users group or in our Gitter room
- Report bugs and feature requests via the issue tracker
- Follow @GetMapStruct on Twitter
- Follow MapStruct on Google+