This question short of answered a similar issue, but it is now a little bit outdated, as macOS AArch64 support was added starting JavaFX 17.
Before JavaFX 17, the javafx.pom parent pom included these Maven profiles:
linux with javafx.platform=linux
macosx with javafx.platform=mac
windows with javafx.platform=win
- And a custom profile
javafx.platform.custom with javafx.platform=${javafx.platform}
With the new architectures supported, and starting JavaFX 17, the parent pom includes the following Maven profiles:
linux-x86_64 with javafx.platform=linux or javafx.platform=linux-monocle
linux-aarch64 with javafx.platform=linux-aarch64 or javafx.platform=linux-aarch64-monocle
linux-arm32 with javafx.platform=linux-arm32-monocle
macosx-x86_64 with javafx.platform=mac or javafx.platform=mac-monocle
macosx-aarch64 with javafx.platform=mac-aarch64 or javafx.platform=mac-aarch64-monocle
windows-x86_64 with javafx.platform=win or javafx.platform=win-monocle
windows-x86 with javafx.platform=win-x86 or javafx.platform=win-x86-monocle
- And a custom profile
javafx.platform.custom with javafx.platform=${javafx.platform}
Therefore, if you want to do a cross-platform build that only includes the dependencies for macOS AArch64 you just need:
mvn package -Djavafx.platform=mac-aarch64
Of course, this only applies to the JavaFX artifacts that Gluon publishes to Maven Center, and not for other distributions (JavaFX SDK or bundled within the Java SDK).
Note: These profiles have a monocle alternative, that can be activated if you include a javafx.monocle property in your pom:
<javafx.monocle>true</javafx.monocle>
This allow using the JavaFX artifacts with or without monocle (the implementation of the Glass windowing component of JavaFX for embedded systems), same as if you download the SDK from https://gluonhq.com/products/javafx/. This is useful, for instance, if you run on the command line of a Raspberry Pi without a windows manager.