首页 > 系统服务 > 详细

解决ClassNotFoundException: Cannot find implementation for xxx?(环境:Mapstruct、Lombok、Maven 和 Eclipse)

时间:2021-07-27 15:35:12      阅读:65      评论:0      收藏:0      [点我收藏+]

一、环境:

Eclipse version:2021-06. ( lasted version)
lombok version:1.18.20 ( lasted version)
m2e-apt:1.5.3 ( lasted version)

二、安装好m2e-apt plugin 好,进行配置

技术分享图片

 

三、pom配置:

 <properties>
        <!-- automatically run annotation processors within the incremental compilation -->
          <m2e.apt.activation>jdt_apt</m2e.apt.activation>
    </properties>
       <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-jdk8</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>

不建议有

<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin> -->

 

 参考链接:

https://github.com/mapstruct/mapstruct/issues/2527

解决ClassNotFoundException: Cannot find implementation for xxx?(环境:Mapstruct、Lombok、Maven 和 Eclipse)

原文:https://www.cnblogs.com/stevenlii/p/15065009.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!