# MapStruct

An annotation processor for generating type-safe bean mappers

Repository: https://github.com/mapstruct/mapstruct
Canonical: https://ross.abutalabs.com/products/mapstruct
Homepage: https://mapstruct.org/
Language: Java
License: NOASSERTION
License Family: other
Topics: mapstruct, java, annotation-processor, mapping, javabeans, no-reflection, bean-mapping, records
Last push: 2026-08-07T00:26:51+00:00
Link (homepage): https://mapstruct.org/
Link (site_page): https://mapstruct.org/documentation/installation
Link (site_page): https://mapstruct.org/faq
Link (site_page): https://mapstruct.org/documentation/reference-guide

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 40, longevity 100
- inputs: {"age_days": 5210, "days_push": 27, "days_rel": 662, "gap_med": 27.0, "n_releases_24m": 3}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7682, forks 1050 (observed 2026-08-28T04:10:02.375963+00:00)

## What it is
MapStruct is a Java annotation processor that generates type-safe, high-performance bean mapping code at compile time, supporting beans, records, and complex object hierarchies. Generated mappers use plain method invocations instead of reflection, producing self-contained code with no runtime dependencies.

## Use cases
- map jpa entities to dtos in java
- generate bean mapper code without reflection
- convert between java records and pojos
- avoid manual getter/setter mapping code
- compile-time type-safe object mapping for android
- map between different object models in layered architecture

## When to choose
- you want fast mapping with no runtime overhead or reflection
- you need compile-time errors for incomplete or incorrect mappings
- you want debuggable, hand-editable generated code
- you target Android or other environments where runtime dependencies are costly

## When to avoid
- you need dynamic runtime mapping of arbitrary objects
- your mappings change frequently at runtime based on configuration
- you're not on the JVM

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools, build-tool
- domain: developer-tools, backend, web-development
- platform: jvm
- tags: bean-mapping, annotation-processor, code-generation, dto-mapping, compile-time, no-reflection, java-records, lombok-compatible, android

## Member repositories
- mapstruct/mapstruct (main) score 77
- mapstruct/mapstruct-examples (examples) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:02.375963+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:36:02.311105+00:00, confidence not recorded.
  - readme: https://github.com/mapstruct/mapstruct (fetched 2026-08-28T04:10:02.375963+00:00, sha ff8254d5b57a)
  - homepage: https://mapstruct.org/ (fetched 2026-08-29T08:31:39.445015+00:00, sha 152d952019e5)
  - site_page: https://mapstruct.org/documentation/installation (fetched 2026-08-29T08:31:39.447598+00:00, sha e7f140311263)
  - site_page: https://mapstruct.org/documentation/reference-guide (fetched 2026-08-29T08:31:39.451341+00:00, sha 1c01cf0af42d)
  - site_page: https://mapstruct.org/faq (fetched 2026-08-29T08:31:39.449344+00:00, sha d9db83a7953b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
