Mapstruct使用问题Couldn't retrieve @Mapper annotation

来源:互联网 发布:eclipse for python 编辑:程序博客网 时间:2024/06/17 03:45

Mapstruct使用问题Couldn’t retrieve @Mapper annotation

在同时使用swagger和mapstruct-jdk8的时候会报错:Couldn't retrieve @Mapper annotation

这个错误解释:

This actually is not a problem on our side. We have 2 packages, mapstruct and mapstruct-jdk8. The problem seems to occur when you have both on the classpath.

You don’t need to exclude the entire swagger for this. You can do this to only exclude the Mapstruct dependency that swagger2 brings with itself:

   <groupId>io.springfox</groupId>   <artifactId>springfox-swagger2</artifactId>   <version>${swagger2.version}</version>   <exclusions>       <exclusion>           <artifactId>org.mapstruct</artifactId>           <groupId>mapstruct</groupId>       </exclusion>   </exclusions></dependency>
阅读全文
0 0
原创粉丝点击