Radouane ROUFID
Radouane ROUFID

Reputation: 10813

Intellij Maven default annotation processors configuration getting lost

I configured my Maven project to work with a Annotation processor options in IntelliJ Idea 2017.1 by adding two options that correspond to two compilerArg of maven-compiler-plugin.

My problem : IntelliJ reset the annotation processing configuration every time the pom.xml is modified. Is there any way to keep the configuration ?

Upvotes: 0

Views: 1387

Answers (1)

Radouane ROUFID
Radouane ROUFID

Reputation: 10813

Fixed with the new version of the Maven compiler plugin

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
        <annotationProcessorPaths>
            <path>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
            </path>
        </annotationProcessorPaths>
        <compilerArgs>
            <arg>-Amapstruct.defaultComponentModel=${mapstruct.defaultComponentModel}</arg>
        </compilerArgs>
    </configuration>
</plugin>

The previous configuration was

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <annotationProcessorPaths>
            <path>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
            </path>
        </annotationProcessorPaths>
        <source>${java.version}</source>
        <target>${java.version}</target>
        <compilerArgs>
            <compilerArg>
                -Amapstruct.defaultComponentModel=${mapstruct.defaultComponentModel}
            </compilerArg>
        </compilerArgs>
    </configuration>
</plugin>

Upvotes: 1

Related Questions