Gradle plugin for easy MapStruct setup
Usage:
plugins {
id 'com.github.akazver.mapstruct' version '1.0.8'
}
MapStruct (required)
- mapstruct (implementation)
- mapstruct-processor (annotationProcessor)
Lombok (optional)
- lombok-mapstruct-binding (annotationProcessor)
Spring (optional)
- mapstruct-spring-annotations (implementation)
- mapstruct-spring-extensions (annotationProcessor)
- mapstruct-spring-test-extensions (testImplementation)
Camel (optional)
- camel-mapstruct (implementation)
- camel-mapstruct-starter (implementation)
- camel-quarkus-mapstruct (implementation)
Plugin adds configuration block which looks like this:
mapstruct {
suppressGeneratorTimestamp = true
verbose = true
suppressGeneratorVersionInfoComment = true
defaultComponentModel = 'spring'
defaultInjectionStrategy = 'constructor'
unmappedTargetPolicy = 'ERROR'
unmappedSourcePolicy = 'ERROR'
disableBuilders = true
nullValueIterableMappingStrategy = 'RETURN_DEFAULT'
nullValueMapMappingStrategy = 'RETURN_DEFAULT'
}
All parameters used according to official documentation