1.springfox已经依赖了mapStruct但是依赖如下
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>1.3.1.Final</version>
<scope>runtime</scope>
</dependency>
runtime,导致maven编译时无效
2.使用@Mapper等各种注解需要添加下面的依赖,否则报初始化失败异常
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</dependency>
3.IDEA2021与MapStruct -version 1.3.1Final的问题,会报如下错误
Internal error in the mapping processor: java.lang.NullPointerException at org.mapstruct.
我直接换了版本1.4.1Final就可以了