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
Official sources
- [1]mapstruct/mapstruct — GitHub repository(2026-10-06)
- [2]MapStruct — README(2026-10-06)
- [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
Get the source
git clone --depth 1 https://github.com/mapstruct/mapstruct.git - 2
Enter the repository
cd mapstruct - 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
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
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- MyBatis20,449 Stars
1 shared tag(s) · 1 shared category(s) · Same language
keep SQL explicit while mapping query results into Java objects
Java - Caffeine17,882 Stars
1 shared tag(s) · 1 shared category(s) · Same language
keep reusable data in a high-performance Java in-memory cache and control size, expiration, and refresh policies to reduce recomputation and I/O
Java - Project Lombok13,481 Stars
3 shared tag(s) · 1 shared category(s) · Same language
generate Java boilerplate such as getters, builders, and logging fields from annotations
Java - Apache Maven5,369 Stars
2 shared tag(s) · 1 shared category(s) · Same language
Standardize Java/JVM builds by sharing dependencies, plugins, and lifecycle rules in a POM
Java - Gradle18,875 Stars
2 shared tag(s) · 1 shared category(s)
unify multi-project builds, tests, dependencies, and packaging through task graphs and plugins
Groovy - Vue Macros1,984 Stars
2 shared tag(s) · 1 shared category(s)
Add compile-time macros and syntax sugar to Vue SFC authoring
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.