OSS TanbouSign in with GitHub

generate type-safe bean, DTO, and record mappers at compile time with an annotation processor

OSS scale score 298.4OSS health 100
About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
7,696
Primary language
Java
License
Apache-2.0
Repository last updated
Sep 24, 2026
On this page

Overview

MapStruct is a Java annotation processor that generates mapper implementations at compile time. It uses ordinary method invocations instead of runtime reflection and reports incomplete or invalid mappings during the build.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Generate plain Java implementations from mapper interfaces

Properties with matching names are mapped by default, while annotations such as @Mapping describe exceptions. Generated code uses normal Java method calls rather than reflection.

Sources: [2]

Catch mapping problems at compile time and support records

Incomplete and invalid mappings become build-time errors, and Java 16+ records are supported alongside conventional beans.

Sources: [2]

Best fit

Fits Java backends with repeated entity, DTO, and API-model conversion

It is useful when teams want less mapping boilerplate without paying for a runtime mapping layer and still want generated code that can be inspected and debugged.

Sources: [2]

Before adoption

Configure annotation processing consistently and review 1.6.3 fixes

Annotation processing must be enabled in Maven, Gradle, and relevant IDEs. Version 1.6.3 fixes issues involving record mapping, Immutables builders, and generated imports.

Sources: [2][3]

Official sources

  1. [1]mapstruct/mapstruct — GitHub repository(2026-10-06)
  2. [2]MapStruct — README(2026-10-06)
  3. [3]MapStruct 1.6.3 release(2026-10-06)
Supplemental curator note

It reduces entity/DTO mapping boilerplate while keeping generated code as ordinary Java method calls. Ensure annotation processing is configured consistently in builds and IDEs.

Try it in 3 steps

  1. 1

    Get the source

    git clone --depth 1 https://github.com/mapstruct/mapstruct.git
  2. 2

    Enter the repository

    cd mapstruct
  3. 3

    Check the official steps

    Continue with the commands in the README Installation, Quick Start, or Getting Started section.

    find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Check the official README

Growth

Growth trends · Last 30 days

7,696 Stars

Trend data is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • annotation-processor
  • bean-mapping
  • java
  • javabeans
  • mapping
  • mapstruct
  • no-reflection
  • records
Stars
7,696
Forks
1,060
Watchers
7,696
Open issues
546
Contributors
159
Owner type
Organization
Primary language
Java
License
Apache-2.0
Repository last updated
Sep 24, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?