From 005f22c581139769b28c749509c15d9e161dea80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Tue, 29 Sep 2026 12:04:06 +0200 Subject: [PATCH] add jpackage profile to build a macos app --- pom.xml | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ readme.md | 4 +++ 2 files changed, 77 insertions(+) diff --git a/pom.xml b/pom.xml index 9750000..e449170 100644 --- a/pom.xml +++ b/pom.xml @@ -110,4 +110,77 @@ + + + + mac-app + + + + org.apache.maven.plugins + maven-resources-plugin + 3.5.0 + + + stage-jpackage-input + package + + copy-resources + + + ${project.build.directory}/jpackage-input + + + ${project.build.directory} + + ${project.build.finalName}-jar-with-dependencies.jar + + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.6.4 + + + jpackage-app-image + package + + exec + + + ${java.home}/bin/jpackage + + --type + app-image + --name + ${project.artifactId} + --dest + ${project.build.directory}/jpackage + --input + ${project.build.directory}/jpackage-input + --main-jar + ${project.build.finalName}-jar-with-dependencies.jar + --main-class + wtf.beatrice.autosqueal.Main + --mac-package-identifier + wtf.beatrice.autosqueal + --mac-package-name + autosqueal + + + + + + + + + + diff --git a/readme.md b/readme.md index 01b2dd9..002e7ae 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,10 @@ 2. `cd` into the directory and run `mvn clean package`. 3. you will find a runnable jar with dependencies in the `target/` folder. 4. run the built jar file with `java -jar target/autosqueal-*-jar-with-dependencies.jar`. + +**macos .app bundle** + - on macos, run `mvn clean package -Pmac-app`: you will find `autosqueal.app` in `target/jpackage/`. + - the first time you run it, grant it the accessibility and screen recording permissions in system settings, like any other java app. ## support | category | info |