Upgrading to 2.0
JavaPackager 2.0 moved to the javapackager organization and changed its coordinates. This page lists everything you may need to change when upgrading from 1.7.x. All the changes are in the release notes.
New coordinates
Everything named io.github.fvarrui is now io.github.javapackager. Versions up to 1.7.6 remain available under the old coordinates.
| What | 1.7.x | 2.0 |
|---|---|---|
Maven groupId | io.github.fvarrui | io.github.javapackager |
| Gradle plugin id | io.github.fvarrui.javapackager.plugin | io.github.javapackager |
| Java packages | io.github.fvarrui.javapackager.* | io.github.javapackager.* |
| Gradle task type | io.github.fvarrui.javapackager.gradle.PackageTask | io.github.javapackager.gradle.PackageTask |
Maven
<plugin>
<groupId>io.github.javapackager</groupId>
<artifactId>javapackager</artifactId>
<version>2.0.0</version>
[...]
</plugin>
Gradle
plugins {
id 'io.github.javapackager' version '2.0.0'
}
With Gradle, the plugins block no longer needs extra repositories, and the old buildscript and apply plugin setup isn't needed. Update every import of the plugin's classes too, e.g. io.github.javapackager.model.MacStartup.
Checklist
- macOS launcher.
macStartupnow defaults toUNIVERSAL, a native launcher that runs natively on Apple Silicon and Intel (it wasSCRIPT). To keep the previous launcher, set<macStartup>SCRIPT</macStartup>(Gradle:macStartup = MacStartup.SCRIPT). The launcher file is stillContents/MacOS/universalJavaApplicationStub, so custom templates keep working. - Zipball and tarball names (Maven). They follow
nameandversionnow, like with Gradle:${name}-${version}-${platform}.zipand.tar.gz(they used to followbuild.finalName). Update the scripts that pick them up, or setzipballNameandtarballName. - AppImage and RPM names. Now
${name}_${version}.AppImage(was${name}.AppImage) and${name}_${version}.rpm(was${name}-${version}-1.<arch>.rpm), like the other installers. vmArgswith spaces. Each element is passed as a single argument, spaces included, so-Dtitle=My Appnow works. In 1.7.x the GNU/Linux script, the macOSSCRIPTlauncher and Launch4j split elements on spaces, so if an element holds several options, like-Xms256m -Xmx1g, split it into one element per option.- Gradle getters. The boolean properties of
PackageTaskusegetX()instead ofisX()(getBundleJre(),getGenerateInstaller(), ...), as Gradle 9 requires. Setting them (bundleJre = true) doesn't change; only code that calls the getters does. - Snapshots are published to the Central Portal snapshots repository.
What you get for free
- Gradle 9 support.
appArgs: default arguments for your app (GNU/Linux and macOS).additionalJlinkArgs, and customized JREs with JDK 24 and newer.- WiX Toolset 4 and newer for MSI installers.
- More modules detected in customized JREs:
jdepsnow analyses your dependencies too. - Many fixes on every platform; see the release notes.