232 lines
8.9 KiB
XML
232 lines
8.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||
<modelVersion>4.0.0</modelVersion>
|
||
|
||
<!-- 父工程配置:Spring Boot 3.4.0 稳定版(兼容 JDK 25) -->
|
||
<parent>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-parent</artifactId>
|
||
<version>3.5.0</version>
|
||
<relativePath/> <!-- 从仓库查找父工程 -->
|
||
</parent>
|
||
|
||
<!-- 项目基本信息 -->
|
||
<groupId>top.awin-x</groupId>
|
||
<artifactId>test05</artifactId>
|
||
<version>0.0.1-SNAPSHOT</version>
|
||
<name>test05</name>
|
||
<description>Test project for Spring Boot (JDK 25)</description>
|
||
<url>https://github.com/awin-x/test05</url> <!-- 可替换为实际仓库地址 -->
|
||
|
||
<!-- 许可证信息(可选,规范项目) -->
|
||
<licenses>
|
||
<license>
|
||
<name>Apache License, Version 2.0</name>
|
||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||
<distribution>repo</distribution>
|
||
</license>
|
||
</licenses>
|
||
|
||
<!-- 开发者信息(可选) -->
|
||
<developers>
|
||
<developer>
|
||
<id>awin-x</id>
|
||
<name>awin-x</name>
|
||
<email>awin-x@example.com</email> <!-- 可替换为实际邮箱 -->
|
||
<roles>
|
||
<role>Developer</role>
|
||
</roles>
|
||
<timezone>+8</timezone>
|
||
</developer>
|
||
</developers>
|
||
|
||
<!-- SCM 版本控制信息(可选) -->
|
||
<scm>
|
||
<connection>scm:git:https://github.com/awin-x/test05.git</connection>
|
||
<developerConnection>scm:git:git@github.com:awin-x/test05.git</developerConnection>
|
||
<url>https://github.com/awin-x/test05</url>
|
||
<tag>HEAD</tag>
|
||
</scm>
|
||
|
||
<!-- 全局属性配置 -->
|
||
<properties>
|
||
<java.version>25</java.version> <!-- 统一 JDK 版本为 25 -->
|
||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||
|
||
<!-- 依赖版本统一管理(便于后续维护) -->
|
||
<mybatis-spring-boot.version>3.0.4</mybatis-spring-boot.version>
|
||
<druid.version>1.2.24</druid.version>
|
||
<sqlite-jdbc.version>3.46.1.0</sqlite-jdbc.version>
|
||
<mysql-connector.version>8.4.0</mysql-connector.version>
|
||
<jjwt.version>0.12.6</jjwt.version>
|
||
<fastjson2.version>2.0.53</fastjson2.version>
|
||
<lombok.version>1.18.38</lombok.version>
|
||
</properties>
|
||
|
||
<dependencies>
|
||
<!-- Spring Web 核心依赖(内置 Tomcat) -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
</dependency>
|
||
|
||
<!-- MyBatis 整合 Spring Boot -->
|
||
<dependency>
|
||
<groupId>org.mybatis.spring.boot</groupId>
|
||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||
<version>${mybatis-spring-boot.version}</version>
|
||
</dependency>
|
||
|
||
<!-- 数据库连接池:Druid(Spring Boot 3 适配版) -->
|
||
<dependency>
|
||
<groupId>com.alibaba</groupId>
|
||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||
<version>${druid.version}</version>
|
||
</dependency>
|
||
|
||
<!-- SQLite 驱动 -->
|
||
<dependency>
|
||
<groupId>org.xerial</groupId>
|
||
<artifactId>sqlite-jdbc</artifactId>
|
||
<version>${sqlite-jdbc.version}</version>
|
||
</dependency>
|
||
|
||
<!-- MySQL 驱动(8.4+ 兼容 JDK 21+) -->
|
||
<dependency>
|
||
<groupId>com.mysql</groupId>
|
||
<artifactId>mysql-connector-j</artifactId> <!-- 新版本artifactId变更(原mysql-connector-java) -->
|
||
<version>${mysql-connector.version}</version>
|
||
<scope>runtime</scope>
|
||
</dependency>
|
||
|
||
<!-- Lombok 简化代码 -->
|
||
<dependency>
|
||
<groupId>org.projectlombok</groupId>
|
||
<artifactId>lombok</artifactId>
|
||
<version>${lombok.version}</version>
|
||
<optional>true</optional> <!-- 不传递依赖 -->
|
||
</dependency>
|
||
|
||
<!-- JWT 认证 -->
|
||
<dependency>
|
||
<groupId>io.jsonwebtoken</groupId>
|
||
<artifactId>jjwt</artifactId>
|
||
<version>${jjwt.version}</version>
|
||
</dependency>
|
||
|
||
<!-- FastJSON2 序列化 -->
|
||
<dependency>
|
||
<groupId>com.alibaba.fastjson2</groupId>
|
||
<artifactId>fastjson2</artifactId>
|
||
<version>${fastjson2.version}</version>
|
||
</dependency>
|
||
|
||
<!-- Spring AOP 支持 -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-aop</artifactId>
|
||
</dependency>
|
||
|
||
<!-- 测试依赖 -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-test</artifactId>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
|
||
<!-- MyBatis 测试支持 -->
|
||
<dependency>
|
||
<groupId>org.mybatis.spring.boot</groupId>
|
||
<artifactId>mybatis-spring-boot-starter-test</artifactId>
|
||
<version>${mybatis-spring-boot.version}</version>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
</dependencies>
|
||
|
||
<build>
|
||
<plugins>
|
||
<!-- Spring Boot 打包插件(支持可执行jar/war) -->
|
||
<plugin>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||
<configuration>
|
||
<!-- 默认激活开发环境profile -->
|
||
<profiles>
|
||
<profile>dev</profile>
|
||
</profiles>
|
||
<!-- 允许 Lombok 注解在打包时生效 -->
|
||
<excludes>
|
||
<exclude>
|
||
<groupId>org.projectlombok</groupId>
|
||
<artifactId>lombok</artifactId>
|
||
</exclude>
|
||
</excludes>
|
||
</configuration>
|
||
</plugin>
|
||
|
||
<!-- Maven 编译插件(适配 JDK 25) -->
|
||
<plugin>
|
||
<groupId>org.apache.maven.plugins</groupId>
|
||
<artifactId>maven-compiler-plugin</artifactId>
|
||
<version>3.14.1</version> <!-- 最新稳定版,兼容 JDK 25 -->
|
||
<configuration>
|
||
<source>${java.version}</source> <!-- 源码 JDK 版本 -->
|
||
<target>${java.version}</target> <!-- 编译目标 JDK 版本 -->
|
||
<encoding>${project.build.sourceEncoding}</encoding>
|
||
<!-- Lombok 注解处理器(确保编译时识别注解) -->
|
||
<annotationProcessorPaths>
|
||
<path>
|
||
<groupId>org.projectlombok</groupId>
|
||
<artifactId>lombok</artifactId>
|
||
<version>${lombok.version}</version>
|
||
</path>
|
||
<!-- 如需 MyBatis 注解处理器(如 @Mapper),可在此添加 -->
|
||
<path>
|
||
<groupId>org.mybatis.spring.boot</groupId>
|
||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||
<version>${mybatis-spring-boot.version}</version>
|
||
</path>
|
||
</annotationProcessorPaths>
|
||
</configuration>
|
||
</plugin>
|
||
|
||
<!-- 可选:测试报告插件(生成规范测试报告) -->
|
||
<plugin>
|
||
<groupId>org.apache.maven.plugins</groupId>
|
||
<artifactId>maven-surefire-plugin</artifactId>
|
||
<version>3.3.1</version>
|
||
<configuration>
|
||
<skipTests>false</skipTests>
|
||
<testFailureIgnore>false</testFailureIgnore>
|
||
</configuration>
|
||
</plugin>
|
||
</plugins>
|
||
</build>
|
||
|
||
<!-- 可选:外置 Tomcat 支持(如需部署到外部 Tomcat,解开以下注释) -->
|
||
<!--
|
||
<packaging>war</packaging>
|
||
|
||
<dependencies>
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.apache.tomcat.embed</groupId>
|
||
<artifactId>tomcat-embed-core</artifactId>
|
||
<scope>provided</scope>
|
||
</dependency>
|
||
</dependencies>
|
||
-->
|
||
</project>
|