美文网首页
关于MapStruct requires Impl class

关于MapStruct requires Impl class

作者: SHUTUP | 来源:发表于2016-12-04 15:49 被阅读222次

前言
最近在实践自己的Spring Boot项目时,为了方便使用,引入了一个MapStruct库,它可以方便的在多种model之间进行转化。然而写好代码后,一运行就报异常,提示需要的实现文件没有,类找不到。
因为我是使用gradle管理的依赖,因此先检查依赖,确认需要的依赖存在。
<pre>
dependencies {
...
compile 'org.mapstruct:mapstruct:1.1.0.Final'
compile group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.1.0.Final'
apt 'org.mapstruct:mapstruct-processor:1.1.0.Final'
...
}
</pre>

检查依赖存在后,如果还是不行
那么在命令行执行

./gradlew build

refrence

I ran into this problem because I didn't run ./gradlew clean build
(gradlew.bat for Windows) after creating/editing the mapper class or related classes.

相关文章

网友评论

      本文标题:关于MapStruct requires Impl class

      本文链接:https://www.haomeiwen.com/subject/kiuhmttx.html