當mapstruct與lombok想結合使用的時候,出現了生成的MapperImpl裏方法,沒有對實體進行轉換的狀況。apache
解決方案:app
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.2</version> <configuration> <source>1.8</source> <!-- or higher, depending on your project --> <target>1.8</target> <!-- or higher, depending on your project --> <annotationProcessorPaths> <path> <groupId>org.mapstruct</groupId> <artifactId>mapstruct-processor</artifactId> <version>${org.mapstruct.version}</version> </path> <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.10</version> </path> </annotationProcessorPaths> </configuration> </plugin>
困惑了好久,上面的代碼,並不能解決這個問題。求大神搭救!!!maven