Library / SDK
modelmapper/modelmapper avatar
modelmapper/modelmapper

ModelMapper for Java object mapping

Intelligent object mapping

2,353 stars349 forksJavaApache-2.0

At a glance

What is it?
ModelMapper is a Java library for convention-based mapping between object types. It fits applications that want a concise mapping API, although the README leaves dependency setup and production troubleshooting undocumented.
Who is it for?
ModelMapper is a reasonable candidate for Java applications that need repeatable mapping across several object types, especially when an optional integration module matches the stack. It is a poor fit when a new user requires a complete installation recipe, explicit control over every property, or documented troubleshooting from the README alone.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • modelmapper/modelmapper2,353 ★ · +1
Star history
Repository2026-10-162026-10-23
modelmapper/modelmapper2.4k2.4k

1 Stars in the last 7 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

ModelMapper's convention-based Java mapping problem

ModelMapper addresses the recurring cost of copying values between Java objects. Applications often represent the same information with separate classes, such as a domain model, a transport model, or a view model. Writing every property transfer by hand creates repetitive code and makes refactoring harder because changes to one class can require matching edits elsewhere.

The README describes ModelMapper as an "intelligent object mapping library" that maps objects automatically while retaining a "convention based approach." That places it between two Java mapping styles. Callers do not need to describe every straightforward property match, but the project also does not present convention mapping as the only option. The API supports handling specific use cases through explicit configuration, which matters when automatic matching would be ambiguous or incomplete.

The intended users are Java developers working across object layers who value a compact mapping API and want mapping logic to survive ordinary refactoring. The repository contains `core/`, `extensions/`, `examples/`, and `groovy/` directories, indicating a library organized around a main implementation, integrations, examples, and Groovy-related code. The documentation does not identify a particular framework as a requirement, so ModelMapper should not be described as Spring-specific merely because the README lists a separate Spring Boot starter under related projects.

The ModelMapper configuration and type-module mechanism

The documented core interaction is registration of an optional module through `modelMapper`. The README gives the expression `modelMapper.registerModule(new TheModule())` as the common mechanism, with `TheModule()` standing in for a concrete integration type. This separates support for optional object or library types from the central mapping API. Listed modules cover Java 8, records, Protocol Buffers, and Vavr.

That list is more important than a generic claim of broad compatibility. A Java application using records does not automatically receive every record-related behavior merely because it uses ModelMapper. The repository links a separate `modelmapper-module-record`, while Protocol Buffers live under `extensions/protobuf`. The two Java 8 and Vavr modules are linked as separate repositories. Based on the repository layout, adopting one of these type systems may therefore require selecting and registering the matching module before the desired mappings are available.

The README does not expose the internal matching algorithm, token resolution rules, expression syntax, or lifecycle of a `ModelMapper` instance. It also does not state whether configuration is mutable after the first mapping. Those details should be checked against modelmapper.org or the relevant module documentation before relying on them. The confirmed design is narrower but clear: conventions drive the default mapping behavior, explicit APIs cover special cases, and modules extend support for selected type ecosystems.

Installing ModelMapper and beginning a mapping

The README does not provide an installation command, dependency coordinate, version, Java requirement, or complete first-use example. It directs readers to modelmapper.org for learning material and displays a Maven Central badge, while the repository root contains `pom.xml` and an `examples/pom.xml`. Their contents are not included in the README, so reproducing a dependency block would risk inventing package names or versions.

For a first use, the only executable project-specific API pattern documented in the README is optional module registration. Substitute the actual module constructor required by the selected integration, register it with the application's `ModelMapper` instance, and then consult the module documentation for the mapping types it supports. The placeholder should not be compiled as written.

The documented registration shape is:

java
modelMapper.registerModule(new TheModule())

This example is instructional rather than a usable program because `TheModule` is a placeholder from the README. Readers should not expect it to compile. The project supplies no accompanying `ModelMapper` creation, source object, destination object, or assertion, so this cannot honestly be presented as a complete tutorial.

For installation, start with the modelmapper.org installation documentation or the current Maven Central entry. If the application uses records, Java 8-specific types, Protocol Buffers, or Vavr, consult the matching module before writing the first mapping. The README confirms those integration paths, but it does not say whether the modules share the core version or require any special build configuration.

Explicit mappings versus hand-written Java transfer code

The closest alternative is direct Java property assignment in a dedicated mapping method or constructor. This approach requires no mapping library and gives the developer explicit control over every source getter, destination setter, transformation, null check, and collection conversion. Its disadvantage for a real alternative analysis is not performance, because the repository contains no reported comparison. The concrete difference is control and repetition.

ModelMapper can reduce repeated property-copy code when source and destination structures follow conventions. It also offers APIs for specific cases, according to the README, and optional modules for several type systems. Direct assignment is more predictable when mapping rules are unusual, when a small number of properties would not justify a dependency, or when each conversion must be visible at the call site. ModelMapper is the better fit when mapping appears throughout an application and the project accepts convention-based behavior to reduce mapper code.

Neither approach automatically proves that every mapped field is correct. The ModelMapper README does not include validation guidance, logging configuration, error policies, or examples of ambiguous mappings. A direct Java mapper makes the expected transfer visible, while ModelMapper reduces boilerplate at the cost of requiring engineers to understand how its conventions resolve properties. That trade-off should be decided using representative classes from the target application rather than a synthetic pair with matching names.

Limits of ModelMapper documentation and debugging evidence

The largest limitation visible in the README is its documentation depth. It does not state how ModelMapper reports missing destination properties, incompatible types, nested-object failures, null values, circular references, or ambiguous source properties. It also does not document validation mode, custom converters, provider selection, mapping cost, thread safety, or rollback behavior. Those omissions do not prove that the features are absent. They mean the README cannot support claims about their availability or behavior.

ModelMapper is also a poor choice when mapping is the core business rule of an application and conventions would conceal those rules. For example, a transformation that depends on domain-specific decisions is easier to audit as explicit Java code unless ModelMapper's configuration API can express it clearly. The README does not show that API in enough detail to evaluate it.

The repository includes a `benchmarks/` directory, but the README reports no benchmark results, workloads, versions, or conclusions. No performance claim can therefore be made from the repository layout. Similarly, `CHANGES.md` is present, but its contents are not included in the README, so upgrade behavior cannot be summarized. A production evaluation would need to inspect those files and exercise mapping operations against the actual source and destination types before choosing it.

ModelMapper maintenance, releases, and Apache-2.0

The repository is not archived, and its last push was on 2026-10-07. That is recent repository activity, but it is not the same as a published release. GitHub has no releases for this repository according to the repository record, so the README's Maven Central badge should not be treated as evidence of a particular release cadence. `CHANGES.md` may contain upgrade information, but its contents are not included in the README.

The maintenance cost depends on the Java and library types in use. The core library is one dependency, while records, Protocol Buffers, Vavr, and Java 8 integrations are documented as modules that must be registered. Some are separate repositories, so an application can accumulate version alignment work across multiple projects. The README does not state whether module versions follow the core release cycle.

The project uses the Apache-2.0 license, also referenced by `LICENSE.txt` and the README badge. This permits use and modification under that license's stated terms, subject to its notice and license conditions. This is a project identification, not legal advice. Teams redistributing artifacts should inspect the actual `LICENSE.txt` and dependency licenses rather than relying only on the core project's badge.

Editorial conclusion

ModelMapper is a reasonable candidate for Java applications that need repeatable mapping across several object types, especially when an optional integration module matches the stack. It is a poor fit when a new user requires a complete installation recipe, explicit control over every property, or documented troubleshooting from the README alone. Before adoption, verify the Maven or Gradle coordinates from ModelMapper Central or modelmapper.org, confirm that the required type module exists, and map representative objects whose names, nesting, or collection behavior differ.

Frequently asked questions

How do I install ModelMapper in a Java project?

The README does not include a dependency coordinate, build command, version, or Java requirement. It directs readers to modelmapper.org and shows a Maven Central badge, so the current installation details must be obtained from those sources.

Does ModelMapper support Java records and Protocol Buffers?

The README lists separate Record and Protocol Buffer modules. It documents the registration pattern `modelMapper.registerModule(new TheModule())`, but does not show a complete configuration for either type.

Can ModelMapper replace hand-written Java property mapping?

It is designed to map objects automatically through conventions and to handle specific cases through its API. The README does not document error handling, custom conversion, or validation, so direct Java mapping may be clearer when every transfer is business-sensitive.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. modelmapper/modelmapper on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/modelmapper-modelmapper.svg)](https://hysenlabs.com/projects/modelmapper-modelmapper)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/modelmapper-modelmapper.svg)](https://hysenlabs.com/projects/modelmapper-modelmapper)

Was this useful?