MapStruct에 대한 Eclipse 지원을 살펴보십시오.
속성에 m2e_apt
을 추가해야합니다.
<properties>
<!-- automatically run annotation processors within the incremental compilation -->
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
</properties>
또한 maven 컴파일러를 올바르게 설정했는지 확인하십시오.
maven-compiler-plugin의 옵션 annotationProcessorPaths
을 사용하는 것이 좋습니다 (컴파일 경로에서 mapstruct 프로세서가 누출되지 않음).
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.6</source> <!-- or higher, depending on your project -->
<target>1.6</target> <!-- or higher, depending on your project -->
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>