Yesterday I fixed generating runtime-image, but now when I want to generate an installer for Mac I am generate a pkg, dmg file, but the app is damaged
For Windows this settings works.
<profile>
<id>jpackage</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>jpackage</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="version" value="1.0"/>
<ant antfile="${basedir}/build.xml">
<target name="current"/>
</ant>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
For Windows
<target name="jpackage-win64">
<echo message="Run jpackage from ${platform}"/>
<exec command="${JAVA_HOME}\bin\jpackage">
<arg line="--type exe"/>
<arg line="--dest installer"/>
<arg line="--name 'DocStore Sync'"/>
<arg line="--vendor 'Esempla Systems S.R.L'"/>
<arg line="--copyright 'Copyright © 2023 Esempla Systems. All rights reserved.'"/>
<arg line="--description 'DocStore Sync application'"/>
<arg line="--license-file src\main\resources\license.txt"/>
<arg line="--app-version ${version}"/>
<arg line="--verbose"/>
<arg line="--win-menu"/>
<arg line="--win-menu-group 'DocStore Sync'"/>
<arg line="--win-dir-chooser"/>
<arg line="--win-shortcut"/>
<arg line="--icon src\main\resources\icon.ico"/>
<arg line="--module docstore.sync/com.esempla.docstore.Launcher"/>
<arg line="--runtime-image target\runtime-image"/>
</exec>
</target>
For mac
<target name="mac">
<echo message="Run jpackage from ${platform}"/>
<exec command="/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/jpackage">
<arg line="--type pkg"/> <!-- Use the pkg type for macOS -->
<arg line="--dest installer"/>
<arg line="--name 'DocStoreSync'"/>
<arg line="--vendor 'Esempla Systems S.R.L'"/>
<arg line="--copyright 'Copyright © 2023 Esempla Systems. All rights reserved.'"/>
<arg line="--description 'DocStore Sync application'"/>
<arg line="--app-version ${version}"/>
<arg line="--verbose"/>
<arg line="--mac-package-identifier com.esempla.docstore"/>
<arg line="--module docstore.sync/com.esempla.docstore.Launcher"/>
<arg line="--main-class docstore.sync/com.esempla.docstore.Launcher"/>
<!-- <arg line="--main-jar docstore-sync-1.0-SNAPSHOT.jar"/>-->
<arg line="--icon src/main/resources/icon.icns"/>
<arg line="--runtime-image target/runtime-image"/>
</exec>
</target>
Runtime image generated with moditect
I want to generate an installer, but it is broken.