Repository navigation
Warning
This is a major release with breaking changes. Read How to upgrade before updating your build.
Breaking changes
- New coordinates, packages and Gradle plugin id. The project moved to the
javapackagerorganization. Everything that was namedio.github.fvarruiis nowio.github.javapackager:- Maven
groupId:io.github.javapackager(wasio.github.fvarrui). - Gradle plugin id:
io.github.javapackager(wasio.github.fvarrui.javapackager.plugin). - Java packages:
io.github.javapackager.*, e.g. the Gradle task typeio.github.javapackager.gradle.PackageTask(wasio.github.fvarrui.javapackager.gradle.PackageTask). - Versions up to 1.7.6 remain available under
io.github.fvarrui.
- Maven
macStartupnow defaults toUNIVERSAL(wasSCRIPT). macOS apps use the new native launcher, which runs natively on both Apple Silicon and Intel. SetmacStartuptoSCRIPTto keep the previous launcher.- Gradle
PackageTaskboolean getters are nowgetX()instead ofisX()(getBundleJre(),getGenerateInstaller(),getAdministratorRequired(), ...), because Gradle 9 ignoresBooleanproperties withisgetters. Build scripts that set them (bundleJre = true) don't change; only code that calls the getters does. - Maven zipball and tarball names now follow the
nameandversionproperties, like the Gradle plugin and the README:${name}-${version}-${platform}.zip/.tar.gz(#489). They used to come frombuild.finalName, so the name changes ifnamediffers from the artifactId;zipballNameandtarballNamestill override it. This also stops two executions in one build from overwriting each other's archive. - AppImage and RPM file names now follow the other installers:
${name}_${version}.AppImageand${name}_${version}.rpm(#481).
How to upgrade
Maven:
<plugin>
<groupId>io.github.javapackager</groupId>
<artifactId>javapackager</artifactId>
<version>2.0.0</version>
[...]
</plugin>Gradle (no extra repositories needed: the plugin is resolved from Maven Central through the Gradle Plugin Portal, #490):
plugins {
id 'io.github.javapackager' version '2.0.0'
}
javapackager {
mainClass = 'path.to.your.mainClass'
[...]
}Then run gradle package. Your own tasks are registered with tasks.register('packageMyApp', io.github.javapackager.gradle.PackageTask) { ... }; in them the app's name property is appName.
To keep the previous macOS launcher:
<macConfig>
<macStartup>SCRIPT</macStartup>
</macConfig>New features
- #305 Default application arguments with the new
appArgsproperty (GNU/Linux and macOS; Windows support is still pending). - #477 WiX Toolset 4+ support: if
wixis inPATHit is used to build MSI and MSM files, otherwise JavaPackager falls back to WiX 3 (candleandlight). See the Windows tools guide. - Native macOS launcher (
nativeJavaApplicationStub) forUNIVERSAL,X86_64andARM64startup types. It should fix the Rosetta and macOS 15 launch problems reported in #448, #449 and #389; please confirm in those issues. - #485 Gradle 9 support: the Gradle plugin no longer uses deprecated Gradle APIs (
JavaPluginConvention,Task.getProject()at execution time,TaskContainer.create()), and the launch4j Gradle plugin is updated to 4.0.0. - #491 New
additionalJlinkArgsproperty: extra arguments appended to thejlinkcall that builds the customized JRE, e.g.--include-locales=en,es(withjdk.localedatainadditionalModules) to drop unused locale data. A--compressgiven there overrides the default one. Thanks @commi! -SNAPSHOTversions are published to the Central Portal snapshots repository (see the README).
Fixed issues
- #421 Customized JRE missing modules:
jdepsnow analyses thelibsfolder and the runnable JAR. - Customized JRE generation failed with JDK 24+ builds that come without
jmods(e.g. Temurin 25, JEP 493):jlinknow links from the JDK's run-time image. The default--compress=2(below JDK 21) is now decided by the packaging JDK's version instead of the Java running Maven or Gradle. - #439 Customized JRE generation failed since 1.7.6 when dependencies split a package across JARs (e.g. netty):
jdepsnow falls back to the class path when it fails on the module path. - #463 AppImage generation failed because
appimagetoolmoved to a new download location. - #470 GNU/Linux startup script didn't quote arguments, so arguments with spaces were split.
- #473 macOS app with
administratorRequired=truedidn't include the launcher, so it didn't start. This may also fix #398; please confirm there. vmArgscontaining spaces broke the Windows EXE built with Launch4j, and were split by the macOSSCRIPTlauncher.appArgscontaining spaces were split by the macOSSCRIPTlauncher.- DMG generation failed intermittently with
hdiutil: ... Resource busyorResource temporarily unavailable;hdiutilcommands are now retried, and the whole image device is detached before compressing it. - #484 Registering a Gradle
PackageTaskwithout applying the plugin failed with aNullPointerException; it now fails with a message saying to applyio.github.javapackager, and the plugin can also be applied after registering the task. - #369 The Inno Setup "Launch" checkbox ran the app as the administrator who approved the install instead of the logged-in user (unless
administratorRequiredistrue). - The
classpathproperty broke the GNU/Linux startup script (java -jartook the whole classpath as a file name), so the app didn't start. - #444 Maven builds that can only reach Maven Central couldn't resolve the plugin: its POM declared the launch4j Gradle library, only published on the Gradle Plugin Portal. Maven users now only need Maven Central; Gradle users get it from the Gradle Plugin Portal, Gradle's default plugin repository.
- Maven API artifacts (
maven-plugin-api,maven-core, ...) were published withruntimescope, so Maven users downloaded old Maven jars they didn't need. They are nowprovided.
Maintenance
- Updated dependencies, including
commons-compress1.28.0,plexus-utils4.1.0,commons-io2.22.0,commons-lang33.21.0,velocity-engine-core2.4.1,jdeb1.14,launch4j-maven-plugin2.7.0 (part of #465) and the launch4j Gradle plugin 4.0.0. The plugin still runs on Java 8. - Smoke tests on every push: the Maven and the Gradle plugin package the same sample app (
samples/hello-world) on GNU/Linux, Windows and macOS (Apple Silicon, everymacStartuptype) and check the generated apps and installers. On macOS the app is also installed from the DMG and from the PKG and opened through Launch Services, like from the Finder (based on #487 by @maths22). It replaces the oldHelloWorldMavenandHelloWorldGradlesample repositories, now archived. - The macOS
SCRIPTlauncher (universalJavaApplicationStub.sh) is now maintained in this repository, since the upstream project is deprecated. The native macOS launcher is maintained in javapackager/nativeJavaApplicationStub (formerlyuniversalJavaApplicationStub). - Documentation: WiX 4+ installation, the Gradle setup with the
pluginsblock (#490), Gradle configuration samples updated (tasks.register(), and fixes to samples that didn't work), and building the plugin with a JDK 17+. - Smoke tests also package with JDK 25.