Springboot集成mapstruct

时间:2025-03-18 08:20:21
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="/POM/4.0.0" xmlns:xsi="http:///2001/XMLSchema-instance" xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0."> <modelVersion>4.0.0</modelVersion> <parent> <groupId></groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId></groupId> <artifactId>gradingdog</artifactId> <version>0.0.1-SNAPSHOT</version> <name>gradingdog</name> <description>Demo project for Spring Boot</description> <properties> <>1.8</> <>1.2.0.Beta2</> <>1.16.14</> </properties> <dependencies> <dependency> <groupId></groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId></groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.0.1</version> </dependency> <!--MapStruct依赖--> <dependency> <groupId></groupId> <artifactId>mapstruct</artifactId> <!-- use mapstruct-jdk8 for Java 8 or higher --> <version>${}</version> </dependency> <dependency> <groupId></groupId> <artifactId>mapstruct-jdk8</artifactId> <version>${}</version> </dependency> <dependency> <groupId></groupId> <artifactId>lombok</artifactId> <version>${}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId></groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId></groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.0</version> <configuration> <source>${}</source> <!-- or higher, depending on your project --> <target>${}</target> <!-- or higher, depending on your project --> <annotationProcessorPaths> <path> <groupId></groupId> <artifactId>lombok</artifactId> <version>${}</version> </path> <path> <groupId></groupId> <artifactId>mapstruct-processor</artifactId> <version>${}</version> </path> </annotationProcessorPaths> <compilerArgs> <arg>-=true</arg> <arg>-=spring</arg> </compilerArgs> </configuration> </plugin> </plugins> </build> </project>