root | db0b96f | 2025-04-20 06:46:16 +0000 | [diff] [blame] | 1 | <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> |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 14 | <!-- 使用 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> |
root | db0b96f | 2025-04-20 06:46:16 +0000 | [diff] [blame] | 19 | </properties> |
| 20 | |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 21 | <!-- 添加依赖 --> |
| 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> |
root | 927f153 | 2025-05-09 05:33:32 +0000 | [diff] [blame] | 29 | <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> |
root | 0d8b11f | 2025-05-15 14:10:43 +0000 | [diff] [blame^] | 54 | <!-- QueryDSL --> |
| 55 | <dependency> |
| 56 | <groupId>com.querydsl</groupId> |
| 57 | <artifactId>querydsl-jpa</artifactId> |
| 58 | <version>4.4.0</version> |
| 59 | </dependency> |
| 60 | <dependency> |
| 61 | <groupId>com.querydsl</groupId> |
| 62 | <artifactId>querydsl-apt</artifactId> |
| 63 | <version>4.4.0</version> |
| 64 | <scope>provided</scope> |
| 65 | </dependency> |
| 66 | <dependency> |
| 67 | <groupId>com.querydsl</groupId> |
| 68 | <artifactId>querydsl-jpa</artifactId> |
| 69 | <version>5.0.0</version> |
| 70 | </dependency> |
| 71 | <dependency> |
| 72 | <groupId>com.querydsl</groupId> |
| 73 | <artifactId>querydsl-apt</artifactId> |
| 74 | <version>5.0.0</version> |
| 75 | <scope>provided</scope> |
| 76 | </dependency> |
| 77 | <dependency> |
| 78 | <groupId>javax.annotation</groupId> |
| 79 | <artifactId>javax.annotation-api</artifactId> |
| 80 | <version>1.3.2</version> |
| 81 | </dependency> |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 82 | </dependencies> |
| 83 | |
| 84 | <!-- 构建配置 --> |
root | db0b96f | 2025-04-20 06:46:16 +0000 | [diff] [blame] | 85 | <build> |
| 86 | <plugins> |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 87 | <!-- 编译插件,设定 Java 9 编译 --> |
| 88 | <plugin> |
| 89 | <groupId>org.apache.maven.plugins</groupId> |
| 90 | <artifactId>maven-compiler-plugin</artifactId> |
| 91 | <version>3.8.1</version> |
| 92 | <configuration> |
| 93 | <release>9</release> |
root | 0d8b11f | 2025-05-15 14:10:43 +0000 | [diff] [blame^] | 94 | <compilerArgs> |
| 95 | <arg>--add-modules</arg> |
| 96 | <arg>java.xml.ws.annotation</arg> |
| 97 | </compilerArgs> |
| 98 | <annotationProcessorPaths> |
| 99 | <path> |
| 100 | <groupId>com.querydsl</groupId> |
| 101 | <artifactId>querydsl-apt</artifactId> |
| 102 | <version>4.4.0</version> |
| 103 | </path> |
| 104 | <path> |
| 105 | <groupId>com.querydsl</groupId> |
| 106 | <artifactId>querydsl-apt</artifactId> |
| 107 | <version>5.0.0</version> |
| 108 | <classifier>jpa</classifier> |
| 109 | </path> |
| 110 | <path> |
| 111 | <groupId>com.querydsl</groupId> |
| 112 | <artifactId>querydsl-jpa</artifactId> |
| 113 | <version>5.0.0</version> |
| 114 | </path> |
| 115 | <path> |
| 116 | <groupId>javax.annotation</groupId> |
| 117 | <artifactId>javax.annotation-api</artifactId> |
| 118 | <version>1.3.2</version> |
| 119 | </path> |
| 120 | </annotationProcessorPaths> |
| 121 | <generatedSourcesDirectory>${project.build.directory}/generated-sources/java</generatedSourcesDirectory> |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 122 | </configuration> |
| 123 | </plugin> |
| 124 | <!-- 执行插件,方便 mvn exec:java 直接运行 --> |
root | db0b96f | 2025-04-20 06:46:16 +0000 | [diff] [blame] | 125 | <plugin> |
| 126 | <groupId>org.codehaus.mojo</groupId> |
| 127 | <artifactId>exec-maven-plugin</artifactId> |
| 128 | <version>3.1.0</version> |
| 129 | <configuration> |
| 130 | <mainClass>api.ApiMain</mainClass> |
| 131 | </configuration> |
| 132 | </plugin> |
root | 0d8b11f | 2025-05-15 14:10:43 +0000 | [diff] [blame^] | 133 | <plugin> |
| 134 | <groupId>com.mysema.maven</groupId> |
| 135 | <artifactId>apt-maven-plugin</artifactId> |
| 136 | <version>1.1.3</version> |
| 137 | <executions> |
| 138 | <execution> |
| 139 | <goals> |
| 140 | <goal>process</goal> |
| 141 | </goals> |
| 142 | <configuration> |
| 143 | <outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory> |
| 144 | <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor> |
| 145 | </configuration> |
| 146 | </execution> |
| 147 | </executions> |
| 148 | </plugin> |
root | db0b96f | 2025-04-20 06:46:16 +0000 | [diff] [blame] | 149 | </plugins> |
| 150 | </build> |
| 151 | |
root | cd43656 | 2025-05-08 14:09:19 +0000 | [diff] [blame] | 152 | </project> |