pom.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 http://maven.apache.org/maven-v4_0_0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <groupId>com.fujica</groupId>
  7. <artifactId>parking_tool</artifactId>
  8. <version>1.0.0</version>
  9. <packaging>jar</packaging>
  10. <name>ParkingSimulator</name>
  11. <properties>
  12. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  13. <maven.compiler.release>25</maven.compiler.release>
  14. <javafx.version>25</javafx.version>
  15. <atlantafx.version>2.1.0</atlantafx.version>
  16. <!-- 当前构建平台 classifier(由下面 profile 自动设置) -->
  17. <javafx.platform>mac</javafx.platform>
  18. <!-- 入口模块/主类 -->
  19. <app.module>com.fujica.parkingtool</app.module>
  20. <app.mainClass>com.fujica.parkingtool.App</app.mainClass>
  21. </properties>
  22. <!-- 根据当前构建机器自动决定 JavaFX native classifier -->
  23. <profiles>
  24. <profile>
  25. <id>mac-aarch64</id>
  26. <activation>
  27. <os><family>mac</family><arch>aarch64</arch></os>
  28. </activation>
  29. <properties>
  30. <javafx.platform>mac-aarch64</javafx.platform>
  31. </properties>
  32. </profile>
  33. <profile>
  34. <id>mac-x86_64</id>
  35. <activation>
  36. <os><family>mac</family><arch>x86_64</arch></os>
  37. </activation>
  38. <properties>
  39. <javafx.platform>mac</javafx.platform>
  40. </properties>
  41. </profile>
  42. <profile>
  43. <id>win-x86_64</id>
  44. <activation>
  45. <os><family>windows</family><arch>amd64</arch></os>
  46. </activation>
  47. <properties>
  48. <javafx.platform>win</javafx.platform>
  49. </properties>
  50. </profile>
  51. <profile>
  52. <id>win-aarch64</id>
  53. <activation>
  54. <os><family>windows</family><arch>aarch64</arch></os>
  55. </activation>
  56. <properties>
  57. <javafx.platform>win-aarch64</javafx.platform>
  58. </properties>
  59. </profile>
  60. <profile>
  61. <id>linux-x86_64</id>
  62. <activation>
  63. <os><family>unix</family><name>linux</name><arch>amd64</arch></os>
  64. </activation>
  65. <properties>
  66. <javafx.platform>linux</javafx.platform>
  67. </properties>
  68. </profile>
  69. <profile>
  70. <id>linux-aarch64</id>
  71. <activation>
  72. <os><family>unix</family><name>linux</name><arch>aarch64</arch></os>
  73. </activation>
  74. <properties>
  75. <javafx.platform>linux-aarch64</javafx.platform>
  76. </properties>
  77. </profile>
  78. </profiles>
  79. <dependencies>
  80. <!-- 仅声明 controls(自动传递 base / graphics)。
  81. 显式带 classifier,确保 dependency-plugin 把当前平台的 native 包拷到 target/modules -->
  82. <dependency>
  83. <groupId>org.openjfx</groupId>
  84. <artifactId>javafx-controls</artifactId>
  85. <version>${javafx.version}</version>
  86. <classifier>${javafx.platform}</classifier>
  87. </dependency>
  88. <dependency>
  89. <groupId>org.openjfx</groupId>
  90. <artifactId>javafx-graphics</artifactId>
  91. <version>${javafx.version}</version>
  92. <classifier>${javafx.platform}</classifier>
  93. </dependency>
  94. <dependency>
  95. <groupId>org.openjfx</groupId>
  96. <artifactId>javafx-base</artifactId>
  97. <version>${javafx.version}</version>
  98. <classifier>${javafx.platform}</classifier>
  99. </dependency>
  100. <!-- javafx-swing 用于把 JavaFX 截图 (WritableImage) 转 BufferedImage 后写 PNG -->
  101. <dependency>
  102. <groupId>org.openjfx</groupId>
  103. <artifactId>javafx-swing</artifactId>
  104. <version>${javafx.version}</version>
  105. <classifier>${javafx.platform}</classifier>
  106. </dependency>
  107. <dependency>
  108. <groupId>io.github.mkpaz</groupId>
  109. <artifactId>atlantafx-base</artifactId>
  110. <version>${atlantafx.version}</version>
  111. </dependency>
  112. <!-- MQTT Paho 客户端,与 devicedriveservice 保持一致 (Eclipse Paho v3) -->
  113. <dependency>
  114. <groupId>org.eclipse.paho</groupId>
  115. <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
  116. <version>1.2.5</version>
  117. </dependency>
  118. <!-- Jackson 用于构造和序列化 MQTT 上行消息体 -->
  119. <dependency>
  120. <groupId>com.fasterxml.jackson.core</groupId>
  121. <artifactId>jackson-databind</artifactId>
  122. <version>2.18.2</version>
  123. </dependency>
  124. <dependency>
  125. <groupId>com.fasterxml.jackson.core</groupId>
  126. <artifactId>jackson-core</artifactId>
  127. <version>2.18.2</version>
  128. </dependency>
  129. <dependency>
  130. <groupId>com.fasterxml.jackson.core</groupId>
  131. <artifactId>jackson-annotations</artifactId>
  132. <version>2.18.2</version>
  133. </dependency>
  134. </dependencies>
  135. <build>
  136. <finalName>${project.artifactId}</finalName>
  137. <plugins>
  138. <!-- 编译为 JDK 25 字节码 -->
  139. <plugin>
  140. <groupId>org.apache.maven.plugins</groupId>
  141. <artifactId>maven-compiler-plugin</artifactId>
  142. <version>3.13.0</version>
  143. <configuration>
  144. <release>25</release>
  145. </configuration>
  146. </plugin>
  147. <!-- 开发期一键运行:mvn javafx:run -->
  148. <plugin>
  149. <groupId>org.openjfx</groupId>
  150. <artifactId>javafx-maven-plugin</artifactId>
  151. <version>0.0.8</version>
  152. <configuration>
  153. <mainClass>${app.module}/${app.mainClass}</mainClass>
  154. <launcher>parking</launcher>
  155. </configuration>
  156. </plugin>
  157. <!-- 把所有运行期模块(含 JavaFX 当前平台原生库 + AtlantaFX)拷到 target/modules
  158. jpackage 会基于该 module-path 自动 jlink 出最小运行时 -->
  159. <plugin>
  160. <groupId>org.apache.maven.plugins</groupId>
  161. <artifactId>maven-dependency-plugin</artifactId>
  162. <version>3.8.1</version>
  163. <executions>
  164. <execution>
  165. <id>copy-modules</id>
  166. <phase>package</phase>
  167. <goals>
  168. <goal>copy-dependencies</goal>
  169. </goals>
  170. <configuration>
  171. <outputDirectory>${project.build.directory}/modules</outputDirectory>
  172. <includeScope>runtime</includeScope>
  173. <!-- 只拷直接声明的依赖:避免 OpenJFX 的空 stub jar 与
  174. AtlantaFX 传递的旧版 javafx-controls 混入 module-path -->
  175. <excludeTransitive>true</excludeTransitive>
  176. <excludeClassifiers>sources,javadoc</excludeClassifiers>
  177. </configuration>
  178. </execution>
  179. </executions>
  180. </plugin>
  181. <!-- 同步把自己的 jar 也拷到 target/modules,方便 scripts 中的 jpackage 引用 -->
  182. <plugin>
  183. <groupId>org.apache.maven.plugins</groupId>
  184. <artifactId>maven-jar-plugin</artifactId>
  185. <version>3.4.1</version>
  186. <configuration>
  187. <outputDirectory>${project.build.directory}/modules</outputDirectory>
  188. </configuration>
  189. </plugin>
  190. </plugins>
  191. </build>
  192. </project>