目录
报错问题:
使用@Mapper 这个注解的时候报了上面的错
mapstruct 报错 java.lang.ClassNotFoundException: Cannot find implementation for
错误原因
因为注解没有引用全。我只引用了一个mapstruct的注解。需要引用多个mapstruct的注解就可以了
问题解决
引用mapstruct的依赖。然后重新启动下服务就可以解决了。
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-jdk8</artifactId>
<version>1.2.0.Beta2</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.2.0.Beta2</version>
</dependency>