| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <?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 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.fujica</groupId>
- <artifactId>parking_tool</artifactId>
- <version>1.0.0</version>
- <packaging>jar</packaging>
- <name>ParkingSimulator</name>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.compiler.release>25</maven.compiler.release>
- <javafx.version>25</javafx.version>
- <atlantafx.version>2.1.0</atlantafx.version>
- <!-- 当前构建平台 classifier(由下面 profile 自动设置) -->
- <javafx.platform>mac</javafx.platform>
- <!-- 入口模块/主类 -->
- <app.module>com.fujica.parkingtool</app.module>
- <app.mainClass>com.fujica.parkingtool.App</app.mainClass>
- </properties>
- <!-- 根据当前构建机器自动决定 JavaFX native classifier -->
- <profiles>
- <profile>
- <id>mac-aarch64</id>
- <activation>
- <os><family>mac</family><arch>aarch64</arch></os>
- </activation>
- <properties>
- <javafx.platform>mac-aarch64</javafx.platform>
- </properties>
- </profile>
- <profile>
- <id>mac-x86_64</id>
- <activation>
- <os><family>mac</family><arch>x86_64</arch></os>
- </activation>
- <properties>
- <javafx.platform>mac</javafx.platform>
- </properties>
- </profile>
- <profile>
- <id>win-x86_64</id>
- <activation>
- <os><family>windows</family><arch>amd64</arch></os>
- </activation>
- <properties>
- <javafx.platform>win</javafx.platform>
- </properties>
- </profile>
- <profile>
- <id>win-aarch64</id>
- <activation>
- <os><family>windows</family><arch>aarch64</arch></os>
- </activation>
- <properties>
- <javafx.platform>win-aarch64</javafx.platform>
- </properties>
- </profile>
- <profile>
- <id>linux-x86_64</id>
- <activation>
- <os><family>unix</family><name>linux</name><arch>amd64</arch></os>
- </activation>
- <properties>
- <javafx.platform>linux</javafx.platform>
- </properties>
- </profile>
- <profile>
- <id>linux-aarch64</id>
- <activation>
- <os><family>unix</family><name>linux</name><arch>aarch64</arch></os>
- </activation>
- <properties>
- <javafx.platform>linux-aarch64</javafx.platform>
- </properties>
- </profile>
- </profiles>
- <dependencies>
- <!-- 仅声明 controls(自动传递 base / graphics)。
- 显式带 classifier,确保 dependency-plugin 把当前平台的 native 包拷到 target/modules -->
- <dependency>
- <groupId>org.openjfx</groupId>
- <artifactId>javafx-controls</artifactId>
- <version>${javafx.version}</version>
- <classifier>${javafx.platform}</classifier>
- </dependency>
- <dependency>
- <groupId>org.openjfx</groupId>
- <artifactId>javafx-graphics</artifactId>
- <version>${javafx.version}</version>
- <classifier>${javafx.platform}</classifier>
- </dependency>
- <dependency>
- <groupId>org.openjfx</groupId>
- <artifactId>javafx-base</artifactId>
- <version>${javafx.version}</version>
- <classifier>${javafx.platform}</classifier>
- </dependency>
- <!-- javafx-swing 用于把 JavaFX 截图 (WritableImage) 转 BufferedImage 后写 PNG -->
- <dependency>
- <groupId>org.openjfx</groupId>
- <artifactId>javafx-swing</artifactId>
- <version>${javafx.version}</version>
- <classifier>${javafx.platform}</classifier>
- </dependency>
- <dependency>
- <groupId>io.github.mkpaz</groupId>
- <artifactId>atlantafx-base</artifactId>
- <version>${atlantafx.version}</version>
- </dependency>
- <!-- MQTT Paho 客户端,与 devicedriveservice 保持一致 (Eclipse Paho v3) -->
- <dependency>
- <groupId>org.eclipse.paho</groupId>
- <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
- <version>1.2.5</version>
- </dependency>
- <!-- Jackson 用于构造和序列化 MQTT 上行消息体 -->
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.18.2</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>2.18.2</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>2.18.2</version>
- </dependency>
- </dependencies>
- <build>
- <finalName>${project.artifactId}</finalName>
- <plugins>
- <!-- 编译为 JDK 25 字节码 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.13.0</version>
- <configuration>
- <release>25</release>
- </configuration>
- </plugin>
- <!-- 开发期一键运行:mvn javafx:run -->
- <plugin>
- <groupId>org.openjfx</groupId>
- <artifactId>javafx-maven-plugin</artifactId>
- <version>0.0.8</version>
- <configuration>
- <mainClass>${app.module}/${app.mainClass}</mainClass>
- <launcher>parking</launcher>
- </configuration>
- </plugin>
- <!-- 把所有运行期模块(含 JavaFX 当前平台原生库 + AtlantaFX)拷到 target/modules
- jpackage 会基于该 module-path 自动 jlink 出最小运行时 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>3.8.1</version>
- <executions>
- <execution>
- <id>copy-modules</id>
- <phase>package</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/modules</outputDirectory>
- <includeScope>runtime</includeScope>
- <!-- 只拷直接声明的依赖:避免 OpenJFX 的空 stub jar 与
- AtlantaFX 传递的旧版 javafx-controls 混入 module-path -->
- <excludeTransitive>true</excludeTransitive>
- <excludeClassifiers>sources,javadoc</excludeClassifiers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- 同步把自己的 jar 也拷到 target/modules,方便 scripts 中的 jpackage 引用 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>3.4.1</version>
- <configuration>
- <outputDirectory>${project.build.directory}/modules</outputDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </project>
|