1

First question: Mapstruct generates code to target annotation folder which has a marker "derived". This is ignored by RTC so I'm unable to check in the generated code (don't ask me why I want to do this - I need it). Is there any chance to disable derived marker on gen-folder so generated classes (.java) could be checked into repository? Second question: Mapstruct classes should be generated on my local machine and not on a build server. How can I configure maven to do it only local?

Thank you in advance.

Currently my pom.xml looks like this since I was not able to configure it the way I need it:

<plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <generatedSourcesDirectory>gen</generatedSourcesDirectory>
                <annotationProcessorPaths>
                    <path>
                        <groupId>de.......</groupId>
                        <artifactId>mapstruct_config</artifactId>
                        <version>${config.version}</version>
                    </path>
                    <path>
                        <groupId>org.mapstruct</groupId>
                        <artifactId>mapstruct-processor</artifactId>
                        <version>${org.mapstruct.version}</version>
                    </path>
                </annotationProcessorPaths>
                <compilerArgs>
                    <compilerArg>
                        -Amapstruct.suppressGeneratorTimestamp=true
                    </compilerArg>
                    <compilerArg>
                        -Amapstruct.suppressGeneratorVersionInfoComment=true
                    </compilerArg>
                    <compilerArg>
                        -Amapstruct.unmappedTargetPolicy=WARN
                    </compilerArg>
                </compilerArgs>
            </configuration>
        </plugin>

1: gen folder has no derived marker 2: annotationProcessor works only on a local machine

D051P0
  • 398
  • 5
  • 17

1 Answers1

0

I presume that the dervied marker comes from Eclipse (IntelliJ also does that). Most probably you would have to manually disable that in your IDE, not sure if it will always work as usually those locations are applied from Maven itself.

In order for the Annotation Processor to run only locally I think that you would need to add a custom maven profile where you would configure the annotationProcessorPaths, the default one (on the CI) won't have the annotationProcessorPaths and thus won't run the annotation processing

Filip
  • 19,269
  • 7
  • 51
  • 60