pom.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <parent>
  7. <groupId>org.springframework.boot</groupId>
  8. <artifactId>spring-boot-starter-parent</artifactId>
  9. <version>3.5.3</version>
  10. <relativePath/>
  11. </parent>
  12. <groupId>com.dms</groupId>
  13. <artifactId>dms-server</artifactId>
  14. <version>0.1.0-SNAPSHOT</version>
  15. <name>dms-server</name>
  16. <description>方案计划文档管理系统后端(SpringBoot 转写版)</description>
  17. <properties>
  18. <java.version>17</java.version>
  19. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  20. <mybatis-starter.version>3.0.5</mybatis-starter.version>
  21. <java-jwt.version>4.4.0</java-jwt.version>
  22. </properties>
  23. <dependencies>
  24. <dependency>
  25. <groupId>org.springframework.boot</groupId>
  26. <artifactId>spring-boot-starter-web</artifactId>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.springframework.boot</groupId>
  30. <artifactId>spring-boot-starter-validation</artifactId>
  31. </dependency>
  32. <!-- ORM:MyBatis -->
  33. <dependency>
  34. <groupId>org.mybatis.spring.boot</groupId>
  35. <artifactId>mybatis-spring-boot-starter</artifactId>
  36. <version>${mybatis-starter.version}</version>
  37. </dependency>
  38. <!-- MySQL 8 驱动与迁移(切换达梦后链接已注释,回切 MySQL 时恢复 .env 链接即可) -->
  39. <dependency>
  40. <groupId>com.mysql</groupId>
  41. <artifactId>mysql-connector-j</artifactId>
  42. <scope>runtime</scope>
  43. </dependency>
  44. <dependency>
  45. <groupId>org.flywaydb</groupId>
  46. <artifactId>flyway-core</artifactId>
  47. </dependency>
  48. <dependency>
  49. <groupId>org.flywaydb</groupId>
  50. <artifactId>flyway-mysql</artifactId>
  51. </dependency>
  52. <!-- 达梦 DM8 JDBC 驱动(当前数据库:DM,默认端口 5236) -->
  53. <dependency>
  54. <groupId>com.dameng</groupId>
  55. <artifactId>DmJdbcDriver18</artifactId>
  56. <version>8.1.3.62</version>
  57. <scope>runtime</scope>
  58. </dependency>
  59. <!-- JWT(HS256,与 Python 版 PyJWT 互通;java-jwt 不强制 256 位密钥,兼容存量密钥) -->
  60. <dependency>
  61. <groupId>com.auth0</groupId>
  62. <artifactId>java-jwt</artifactId>
  63. <version>${java-jwt.version}</version>
  64. </dependency>
  65. <!-- Argon2id 密码哈希(仅用 crypto 模块,不引入 Security 过滤链) -->
  66. <dependency>
  67. <groupId>org.springframework.security</groupId>
  68. <artifactId>spring-security-crypto</artifactId>
  69. </dependency>
  70. <!-- Argon2 实现依赖 BouncyCastle(spring-security-crypto 声明为 optional,需显式引入) -->
  71. <dependency>
  72. <groupId>org.bouncycastle</groupId>
  73. <artifactId>bcprov-jdk18on</artifactId>
  74. <version>1.78.1</version>
  75. </dependency>
  76. <!-- 正文提取:PDF(对齐 Python PyMuPDF) -->
  77. <dependency>
  78. <groupId>org.apache.pdfbox</groupId>
  79. <artifactId>pdfbox</artifactId>
  80. <version>3.0.5</version>
  81. </dependency>
  82. <!-- 正文提取:DOCX(对齐 Python python-docx) -->
  83. <dependency>
  84. <groupId>org.apache.poi</groupId>
  85. <artifactId>poi-ooxml</artifactId>
  86. <version>5.4.1</version>
  87. </dependency>
  88. <dependency>
  89. <groupId>org.projectlombok</groupId>
  90. <artifactId>lombok</artifactId>
  91. <optional>true</optional>
  92. </dependency>
  93. <dependency>
  94. <groupId>org.springframework.boot</groupId>
  95. <artifactId>spring-boot-starter-test</artifactId>
  96. <scope>test</scope>
  97. </dependency>
  98. </dependencies>
  99. <build>
  100. <!-- 产物名对齐 Python 版 dms-server.exe:dms-server.jar -->
  101. <finalName>dms-server</finalName>
  102. <plugins>
  103. <!-- 内置 DMS 资源(UI字典/关系预置),等价 PyInstaller 的 _internal/dms/resources -->
  104. <plugin>
  105. <artifactId>maven-resources-plugin</artifactId>
  106. <executions>
  107. <execution>
  108. <id>copy-dms-resources</id>
  109. <phase>process-resources</phase>
  110. <goals>
  111. <goal>copy-resources</goal>
  112. </goals>
  113. <configuration>
  114. <outputDirectory>${project.build.outputDirectory}/dms-resources</outputDirectory>
  115. <resources>
  116. <resource>
  117. <directory>../backend/dms/resources</directory>
  118. </resource>
  119. </resources>
  120. </configuration>
  121. </execution>
  122. </executions>
  123. </plugin>
  124. <plugin>
  125. <groupId>org.apache.maven.plugins</groupId>
  126. <artifactId>maven-surefire-plugin</artifactId>
  127. <configuration>
  128. <excludes>
  129. <!-- 备份功能已验证稳定,打包时跳过其引擎级测试(-Dtest=BackupEngineTest 可显式单跑) -->
  130. <exclude>**/backup/**</exclude>
  131. </excludes>
  132. </configuration>
  133. </plugin>
  134. <plugin>
  135. <groupId>org.springframework.boot</groupId>
  136. <artifactId>spring-boot-maven-plugin</artifactId>
  137. <configuration>
  138. <excludes>
  139. <exclude>
  140. <groupId>org.projectlombok</groupId>
  141. <artifactId>lombok</artifactId>
  142. </exclude>
  143. </excludes>
  144. </configuration>
  145. </plugin>
  146. </plugins>
  147. </build>
  148. <profiles>
  149. <!-- 前端合并部署:frontend/dist 复制进 jar 的 classpath:/static,
  150. 由 SpaController/FrontendAssets 托管(等价 PyInstaller 内置 frontend_dist)。
  151. 用法:先构建前端(frontend 下 npm run build),再 mvn package -Pfrontend -->
  152. <profile>
  153. <id>frontend</id>
  154. <build>
  155. <plugins>
  156. <plugin>
  157. <artifactId>maven-resources-plugin</artifactId>
  158. <executions>
  159. <execution>
  160. <id>copy-frontend-dist</id>
  161. <phase>process-resources</phase>
  162. <goals>
  163. <goal>copy-resources</goal>
  164. </goals>
  165. <configuration>
  166. <outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
  167. <resources>
  168. <resource>
  169. <directory>../frontend/dist</directory>
  170. </resource>
  171. </resources>
  172. </configuration>
  173. </execution>
  174. </executions>
  175. </plugin>
  176. </plugins>
  177. </build>
  178. </profile>
  179. </profiles>
  180. </project>