2017-05-16 2 views
0

verirren konfigurierte ich mein Maven Projekt mit einem Annotation processor options in IntelliJ Idea 2.017,1 zu arbeiten, indem sie zwei Optionen hinzufügen, die zu zwei compilerArg von maven-compiler-plugin entsprechen.Intellij Maven Standard Anmerkung Prozessor Konfiguration

Mein Problem: IntelliJ setzt die Annotationsverarbeitungskonfiguration jedes Mal zurück, wenn die pom.xml geändert wird. Gibt es eine Möglichkeit, die Konfiguration beizubehalten?

+0

Warum wollen Sie IntelliJ Werkzeug genau benutzen? Kannst du nicht weiterhin maven-compiler-plugin verwenden? – user1643723

Antwort

0

mit der neuen Version des Plug-ins Maven Compiler behoben

<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> 

Die vorherige Konfiguration

war
<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>