使用lombok 插件后,mapstruct 不生效

背景:

springboot 项目使用 lombok 插件后,添加 mapstruct  插件,maven 编译时 mapstruct 插件不起作用。

 

目前先匆匆记录一下一种解决方案

一种解决方案:

pom 文件中加入以下依赖。笔者使用的 mapstruct 版本为 1.3.0.Final

 <!--  解决lombok插件和 mapstruct 冲突导致 mapstruct 不可用 -->
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>1.3.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-jdk8</artifactId>
            <version>1.3.0.Final</version>
        </dependency>
 
发布了51 篇原创文章 · 获赞 6 · 访问量 10万+

猜你喜欢

转载自blog.csdn.net/H_Rhui/article/details/105516280