Reputation: 77
I want to disable @Generate annotation in generated (by mapstruct) classes.
I try args
-Amapstruct.suppressGeneratorTimestamp=true
and
-Amapstruct.suppressGeneratorVersionInfoComment=true
, but it's still do not turn off annotation.
In the source code of mapstruct I found class GeneratedType
, which has in constructor declare a field generatedTypeAvailable
, which affect on a template GeneratedType.ftl
:
<#if !generatedTypeAvailable>/*</#if>
@Generated(
value = "org.mapstruct.ap.MappingProcessor"<#if suppressGeneratorTimestamp == false>,
date = "${.now?string("yyyy-MM-dd'T'HH:mm:ssZ")}"</#if><#if suppressGeneratorVersionComment == false>,
comments = "version: ${versionInformation.mapStructVersion}, compiler: ${versionInformation.compiler}, environment: Java ${versionInformation.runtimeVersion} (${versionInformation.runtimeVendor})"</#if>
)<#if !generatedTypeAvailable>
*/</#if>
So, how to set field value generatedTypeAvailable
to false
?
Upvotes: 3
Views: 1542
Reputation: 21403
Currently it is not possible to disable the creation of the @Generated
annotation. Why do you need to do that?
What you can do is to:
-Amapstruct.suppressGeneratorTimerstamp=true
-Amapstruct.suppressGeneratorVersionInfoComment
Upvotes: 1