MapStruct 1.4.2.Final bug fix released

It is my pleasure to announce the 1.4.2.Final bug fix release of MapStruct.

This release includes 2 enhancements, 10 bug fixes, and some documentation fixes.

The most notable enhancement is the relaxing of the strictness for Mapping#qualifiedByName and Mapping#qualifier for collection mappings.

Relaxing qualifiers for collections

In 1.4.0 we made the qualifiers stricter, which lead to certain things like delegating the Mapping#qualifiedByName and Mapping#qualifiedBy no longer working. We relaxed this in 1.4.2 and now the following example works again.

public interface TopologyMapper {

    @Mapping( target = "topologyFeatures", qualifiedByName = "Rivers" )
    Topology mapTopologyAsRiver(TopologyDto dto);

    default TopologyFeature mapRiver( TopologyFeatureDto dto ) {
        if ( dto instanceof RiverDto ) {
            River river = new River();
            river.setLength( ( (RiverDto) dto ).getLength() );
            river.setName(  dto.getName() );
            return river;

        throws UnsupportedOperationException( "dto is not an instance of RiverDto" );



Thanks to our entire community for reporting these errors and being patient with our release schedule.

Happy coding with MapStruct 1.4.2!!


You can fetch the new release from Maven Central using the following GAV coordinates:

Alternatively, you can get ZIP and TAR.GZ distribution bundles - containing all the JARs, documentation etc. - from GitHub.

If you run into any trouble or would like to report a bug, feature request or similar, use the following channels to get in touch:

comments powered by Disqus