MapStruct-Plus 使用教程

时间:2025-03-18 08:14:34
<properties> <>19</> <>1.3.5</> <>1.18.30</> </properties> <dependencies> <dependency> <groupId></groupId> <artifactId>mapstruct-plus-spring-boot-starter</artifactId> <version>${}</version> </dependency> <!-- knife4j 版本4.0.0——SpringBoot版本兼容性 --> <dependency> <groupId></groupId> <artifactId>knife4j-openapi2-spring-boot-starter</artifactId> <version>4.0.0</version> <exclusions> <exclusion> <groupId></groupId> <artifactId>mapstruct</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <plugins> <plugin> <!-- maven-compiler-plugin作用:指定 Java 版本、设置编码方式 --> <groupId></groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>${}</source> <target>${}</target> <annotationProcessorPaths> <path> <groupId></groupId> <artifactId>lombok</artifactId> <version>${}</version> </path> <path> <groupId></groupId> <artifactId>mapstruct-plus-processor</artifactId> <version>${}</version> </path> <!-- 将 Lombok 注解和 MapStruct 的映射注解进行绑定,使它们能够协同工作 --> <path> <groupId></groupId> <artifactId>lombok-mapstruct-binding</artifactId> <version>0.2.0</version> </path> </annotationProcessorPaths> </configuration> </plugin> </plugins> </build>