做海报在哪个网站可以找素材公共资源交易中心怎么样
在mapStruct上边,如果我们要切换成非默认的组件模式,常常要在@Mapper注释中添加componentModel = "spring",如果类太多的了的话,非常麻烦,有没有更好的方式呢,有的,可以在pom中添加一个编译参数,这样就不用每个Mapper注解添加componentModel属性了
<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-compiler-plugin</artifactId>
     <version>xxx</version>
     <configuration>
         <source>1.8</source>
         <target>1.8</target>
         <annotationProcessorPaths>
            <path>
                 <groupId>org.projectlombok</groupId>
                 <artifactId>lombok</artifactId>
                 <version>xxx</version>
             </path>
             <path>
                 <groupId>org.mapstruct</groupId>
                 <artifactId>mapstruct-processor</artifactId>
                 <version>xxx</version>
             </path>
         </annotationProcessorPaths>
         <compilerArgs>
             <compilerArg>
                 -Amapstruct.defaultComponentModel=spring
             </compilerArg>
         </compilerArgs>
     </configuration>
 </plugin>
