blob: 1590f5d37258cd1708017d5bf7eca16512ab7d46 [file] [log] [blame]
rootdb0b96f2025-04-20 06:46:16 +00001<project xmlns="http://maven.apache.org/POM/4.0.0"
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
6 <!-- 基本坐标 -->
7 <modelVersion>4.0.0</modelVersion>
8 <groupId>com.example</groupId>
9 <artifactId>simple-maven-project</artifactId>
10 <version>1.0-SNAPSHOT</version>
11
12 <!-- 指定 Java 版本 -->
13 <properties>
rootcd436562025-05-08 14:09:19 +000014 <!-- 使用 Java 9,以支持接口中的 private 方法 -->
15 <maven.compiler.source>9</maven.compiler.source>
16 <maven.compiler.target>9</maven.compiler.target>
17 <!-- 推荐使用 release 模式,自动设置 source/target -->
18 <maven.compiler.release>9</maven.compiler.release>
rootdb0b96f2025-04-20 06:46:16 +000019 </properties>
20
rootcd436562025-05-08 14:09:19 +000021 <!-- 添加依赖 -->
22 <dependencies>
23 <!-- Apache Commons Lang3,用于 Pair 等工具类 -->
24 <dependency>
25 <groupId>org.apache.commons</groupId>
26 <artifactId>commons-lang3</artifactId>
27 <version>3.12.0</version>
28 </dependency>
root927f1532025-05-09 05:33:32 +000029 <dependency>
30 <groupId>javax.persistence</groupId>
31 <artifactId>javax.persistence-api</artifactId>
32 <version>2.2</version>
33 </dependency>
34 <dependency>
35 <groupId>org.hibernate</groupId>
36 <artifactId>hibernate-core</artifactId>
37 <version>5.6.14.Final</version>
38 </dependency>
39 <dependency>
40 <groupId>mysql</groupId>
41 <artifactId>mysql-connector-java</artifactId>
42 <version>8.0.32</version>
43 </dependency>
44 <dependency>
45 <groupId>org.slf4j</groupId>
46 <artifactId>slf4j-api</artifactId>
47 <version>1.7.36</version>
48 </dependency>
49 <dependency>
50 <groupId>org.slf4j</groupId>
51 <artifactId>slf4j-simple</artifactId>
52 <version>1.7.36</version>
53 </dependency>
rootcd436562025-05-08 14:09:19 +000054 </dependencies>
55
56 <!-- 构建配置 -->
rootdb0b96f2025-04-20 06:46:16 +000057 <build>
58 <plugins>
rootcd436562025-05-08 14:09:19 +000059 <!-- 编译插件,设定 Java 9 编译 -->
60 <plugin>
61 <groupId>org.apache.maven.plugins</groupId>
62 <artifactId>maven-compiler-plugin</artifactId>
63 <version>3.8.1</version>
64 <configuration>
65 <release>9</release>
66 </configuration>
67 </plugin>
68 <!-- 执行插件,方便 mvn exec:java 直接运行 -->
rootdb0b96f2025-04-20 06:46:16 +000069 <plugin>
70 <groupId>org.codehaus.mojo</groupId>
71 <artifactId>exec-maven-plugin</artifactId>
72 <version>3.1.0</version>
73 <configuration>
74 <mainClass>api.ApiMain</mainClass>
75 </configuration>
76 </plugin>
77 </plugins>
78 </build>
79
rootcd436562025-05-08 14:09:19 +000080</project>