Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Maven Central](http://img.shields.io/maven-central/v/io.github.fvarrui/javapackager)](https://search.maven.org/artifact/io.github.fvarrui/javapackager)
[![GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-%250778B9.svg)](https://www.gnu.org/licenses/gpl-3.0.html)

JavaPackager is a hybrid plugin for **Maven** and **Gradle** which provides an easy way to package Java applications in native Windows, Mac OS X or GNU/Linux executables, and generate installers for them.
JavaPackager is a hybrid plugin for **Maven** and **Gradle** which provides an easy way to package Java applications in native Windows, MacOS or GNU/Linux executables, and generate installers for them.

> SNAPSHOT version is not released to Maven Central, so you have to [install it manually](#how-to-build-and-install-the-plugin).

Expand Down Expand Up @@ -132,8 +132,8 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
| `${name}_${version}.exe` | Setup file. | Windows | [Inno Setup](http://www.jrsoftware.org/isinfo.php) |
| `${name}_${version}.msi` | MSI installer file. | Windows | [WiX Toolset](https://wixtoolset.org/) |
| `${name}_${version}.msm` | MSI merge module file. | Windows | [WiX Toolset](https://wixtoolset.org/) |
| `${name}_${version}.dmg` | Disk image file (uses **hdiutil**). | Mac OS | |
| `${name}_${version}.pkg` | PKG installer file (uses **pkgbuild**). | Mac OS | |
| `${name}_${version}.dmg` | Disk image file (uses **hdiutil**). | MacOS | |
| `${name}_${version}.pkg` | PKG installer file (uses **pkgbuild**). | MacOS | |
| `${name}-${version}-${platform}.zip` | Zipball containing generated directory `${name}`. | All | |
| `${name}-${version}-${platform}.tar.gz` | Compressed tarball containing generated directory `${name}`. | All | |
| `assets` | Directory with all intermediate files generated by JavaPackager. | All | |
Expand All @@ -157,7 +157,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
| `customizedJre` | :x: | `true` | Generates a customized JRE, including only identified or specified modules. Otherwise, all modules will be included. |
| `description` | :x: | `${project.description}` or `${displayName}` | Project description. |
| `displayName` | :x: | `${project.name}` or `${name}` | App name to show. |
| `envPath` | :x: | | Defines PATH environment variable in GNU/Linux and Mac OS X startup scripts. |
| `envPath` | :x: | | Defines PATH environment variable in GNU/Linux and MacOS startup scripts. |
| `extra` | :x: | | Map with extra properties to be used in customized Velocity templates, accesible through `$info.extra` variable. |
| `fileAssociations` | :x: | [`FileAssociation[]`](https://github.com/fvarrui/JavaPackager/blob/master/src/main/java/io/github/fvarrui/javapackager/model/FileAssociation.java) | Associate file extensions or MIME types to the app. |
| `forceInstaller` | :x: | `false` | If `true`, skips operating system check when generating installers. |
Expand All @@ -180,7 +180,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
| `runnableJar` | :x: | | Defines your own JAR file to be bundled. If it's ommited, the plugin packages your code in a runnable JAR and bundle it with the app. |
| `scripts` | :x: | | Specify bootstrap script. **Pre and post-install scripts comming soon!** |
| `url` | :x: | | App website URL. |
| `useResourcesAsWorkingDir` | :x: | `true` | Uses app resources folder as default working directory (always `true` on Mac OS). |
| `useResourcesAsWorkingDir` | :x: | `true` | Uses app resources folder as default working directory (always `true` on MacOS). |
| `version` | :x: | `${project.version}` | App version. |
| `vmArgs` | :x: | `[]` | VM arguments. |

Expand All @@ -191,7 +191,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
| Property | Mandatory | Description |
| ------------- | --------- | ------------------------------------------------------------------- |
| `linuxConfig` | :x: | [GNU/Linux specific properties](docs/linux-specific-properties.md). |
| `macConfig` | :x: | [Mac OS X specific properties](docs/macosx-specific-properties.md). |
| `macConfig` | :x: | [MacOS specific properties](docs/macosx-specific-properties.md). |
| `winConfig` | :x: | [Windows specific properties](docs/windows-specific-properties.md). |

> :warning: Be careful when using the `platform` property if your project uses platform dependent libraries, so the libraries of the current platform will be copied, not those required for the target platform. You can solve this problem using `classifiers`.
Expand All @@ -216,7 +216,7 @@ ${assetsDir}/
├── linux/
│ └── ${name}.png # on GNU/Linux it has to be a PNG file
├── mac/
│ └── ${name}.icns # on Mac OS X it has to be a ICNS file
│ └── ${name}.icns # on MacOS it has to be a ICNS file
└── windows/
└── ${name}.ico # on Windows it has to be a ICO file
```
Expand All @@ -239,7 +239,7 @@ ${assetsDir}/
| ├── mime.xml.vtl # MIME.XML template
│ └── startup.sh.vtl # Startup script template
├── mac/
| ├── assembly.xml.vtl # maven-assembly-plugin template to generate ZIP/TGZ bundles for Mac OS X
| ├── assembly.xml.vtl # maven-assembly-plugin template to generate ZIP/TGZ bundles for MacOS
| ├── customize-dmg.applescript.vtl # DMG customization Applescript template
| ├── Info.plist.vtl # Info.plist template
│ └── startup.vtl # Startup script template
Expand All @@ -262,7 +262,7 @@ You can use [default templates](https://github.com/fvarrui/JavaPackager/tree/mas

When you build your app, all configuration details are hardcoded into the executable and cannot be changed without recreating it or hacking with a resource editor. JavaPackager introduces a feature that allows to pass additional JVM options at runtime from an `.l4j.ini` file (like [Launch4j](http://launch4j.sourceforge.net/docs.html) does, but available for all platforms in the same way). So, you can specify these options in the packager's configuration (packaging time), in INI file (runtime) or in both.

The INI file's name must correspond to `${name}.l4j.ini` and it has to be located next to the executable on Windows and GNU/Linux, and in `Resources` folder on Mac OS X.
The INI file's name must correspond to `${name}.l4j.ini` and it has to be located next to the executable on Windows and GNU/Linux, and in `Resources` folder on MacOS.

The options should be separated with spaces or new lines:

Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gradlePlugin {
pluginBundle {
website = 'http://github.com/fvarrui/JavaPackager'
vcsUrl = 'http://github.com/fvarrui/JavaPackager.git'
description = 'Packages Java applications as native Windows, Mac OS X or GNU/Linux executables and creates installers for them'
description = 'Packages Java applications as native Windows, MacOS or GNU/Linux executables and creates installers for them'
tags = ['java', 'packager', 'gradle-plugin', 'maven-plugin', 'native', 'installer', 'debian-packages', 'rpm-packages', 'dmg', 'maven', 'gradle', 'distribution', 'javapackager', 'linux-executables', 'deb', 'rpm', 'native-windows', 'java-applications', 'pkg', 'msi']
plugins {
javaPackagerPlugin {
Expand Down Expand Up @@ -243,4 +243,3 @@ task updateUniversalJavaApplicationStub(type : Download) {
dest file('src/main/resources/mac')
overwrite true
}

4 changes: 2 additions & 2 deletions docs/gradle/plugin-configuration-samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ task packageMyApp(dependsOn: [ 'packageMyAppForLinux', 'packageMyAppForMac', 'pa
E.g. on Windows, running `packageMyApp` task will generate next artifacts:

* `${name}_${version}-linux.tar.gz` with the GNU/Linux application including a customized JRE.
* `${name}_${version}-mac.tar.gz` with the Mac OS X application including a customized JRE.
* `${name}_${version}-mac.tar.gz` with the MacOS application including a customized JRE.
* `${name}_${version}-windows.zip` with the Windows application including a customized JRE.

As last sample is running on Windows, it's not necessary to specify a JDK when bundling for Windows (it uses current JDK by default). Otherwise, if running on GNU/Linux or Mac OS X, you have to specify a JDK for Windows.
As last sample is running on Windows, it's not necessary to specify a JDK when bundling for Windows (it uses current JDK by default). Otherwise, if running on GNU/Linux or MacOS, you have to specify a JDK for Windows.
4 changes: 2 additions & 2 deletions docs/macosx-specific-properties.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mac OS X specific properties
# MacOS specific properties

```xml
<macConfig>
Expand Down Expand Up @@ -64,7 +64,7 @@
| `developerId` | :x: | | Signing identity. |
| `entitlements` | :x: | | Path to [entitlements](https://developer.apple.com/documentation/bundleresources/entitlements) file. |
| `codesignApp` | :x: | `true` | If it is set to `false`, generated app will not be codesigned. |
| `hardenedCodesign` | :x: | `true` | If it is set to `true`, enable [hardened runtime](https://developer.apple.com/documentation/security/hardened_runtime) if Mac OS version >= 10.13.6. |
| `hardenedCodesign` | :x: | `true` | If it is set to `true`, enable [hardened runtime](https://developer.apple.com/documentation/security/hardened_runtime) if MacOS version >= 10.13.6. |
| `macStartup` | :x: | `SCRIPT` | App startup type, using a `SCRIPT` or a binary (compiled version of the script: `UNIVERSAL`, `X86_64` or `ARM64`). |

## DMG generation properties
Expand Down
4 changes: 2 additions & 2 deletions docs/maven/plugin-configuration-samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ E.g. on Windows, last configuration will generate next artifacts:
E.g. on Windows, last configuration will generate next artifacts:

* `${name}_${version}-linux.tar.gz` with the GNU/Linux application including a customized JRE.
* `${name}_${version}-mac.tar.gz` with the Mac OS X application including a customized JRE.
* `${name}_${version}-mac.tar.gz` with the MacOS application including a customized JRE.
* `${name}_${version}-windows.zip` with the Windows application including a customized JRE.

As last sample is running on Windows, it's not necessary to specify a JDK when bundling for Windows (it uses current JDK by default). Otherwise, if running on GNU/Linux or Mac OS X, you have to specify a JDK for Windows.
As last sample is running on Windows, it's not necessary to specify a JDK when bundling for Windows (it uses current JDK by default). Otherwise, if running on GNU/Linux or MacOS, you have to specify a JDK for Windows.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public List<File> getOutputFiles() {
public AbstractPackageTask() {
super();
setGroup(PackagePlugin.GROUP_NAME);
setDescription("Packages the application as a native Windows, Mac OS X or GNU/Linux executable and creates an installer");
setDescription("Packages the application as a native Windows, MacOS or GNU/Linux executable and creates an installer");
getOutputs().upToDateWhen(o -> false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public class PackageMojo extends AbstractMojo {
private Platform platform;

/**
* Defines PATH environment variable in GNU/Linux and Mac OS X startup scripts.
* Defines PATH environment variable in GNU/Linux and MacOS startup scripts.
*/
@Parameter(property = "envPath", required = false)
private String envPath;
Expand Down Expand Up @@ -232,7 +232,7 @@ public class PackageMojo extends AbstractMojo {
private LinuxConfig linuxConfig;

/**
* Mac OS X specific config
* MacOS specific config
*/
@Parameter(property = "macConfig", required = false)
private MacConfig macConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.github.fvarrui.javapackager.packagers.Packager;

/**
* JavaPackager Mac OS specific configuration
* JavaPackager MacOS specific configuration
*/
public class MacConfig implements Serializable {
private static final long serialVersionUID = -2268944961932941577L;
Expand Down Expand Up @@ -270,7 +270,7 @@ public String toString() {
}

/**
* Tests Mac OS X specific config and set defaults if not specified
* Tests MacOS specific config and set defaults if not specified
*
* @param packager Packager
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ protected File doApply(Packager packager) throws Exception {

}

// removes jre/legal folder as it causes problems when codesigning from Mac OS
// removes jre/legal folder as it causes problems when codesigning from MacOS
File legalFolder = new File(destinationFolder, "legal");
if (legalFolder.exists()) {
FileUtils.removeFolder(legalFolder);
}

// removes jre/man folder as it causes problems when codesigning from Mac OS
// removes jre/man folder as it causes problems when codesigning from MacOS
File manFolder = new File(destinationFolder, "man");
if (manFolder.exists()) {
FileUtils.removeFolder(manFolder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import io.github.fvarrui.javapackager.utils.XMLUtils;

/**
* Packager for Mac OS X
* Packager for MacOS
*/
public class MacPackager extends Packager {

Expand All @@ -38,12 +38,12 @@ public void doInit() throws Exception {

this.macConfig.setDefaults(this);

// FIX useResourcesAsWorkingDir=false doesn't work fine on Mac OS (option
// FIX useResourcesAsWorkingDir=false doesn't work fine on MacOS (option
// disabled)
if (!this.isUseResourcesAsWorkingDir()) {
this.useResourcesAsWorkingDir = true;
Logger.warn(
"'useResourcesAsWorkingDir' property disabled on Mac OS (useResourcesAsWorkingDir is always true)");
"'useResourcesAsWorkingDir' property disabled on MacOS (useResourcesAsWorkingDir is always true)");
}

}
Expand Down Expand Up @@ -204,9 +204,9 @@ private void codesign(String developerId, File entitlements, File appFile) throw
List<String> flags = new ArrayList<>();
if (macConfig.isHardenedCodesign()) {
if (VersionUtils.compareVersions("10.13.6", SystemUtils.OS_VERSION) >= 0) {
flags.add("runtime"); // enable hardened runtime if Mac OS version >= 10.13.6
flags.add("runtime"); // enable hardened runtime if MacOS version >= 10.13.6
} else {
Logger.warn("Mac OS version detected: " + SystemUtils.OS_VERSION + " ... hardened runtime disabled!");
Logger.warn("MacOS version detected: " + SystemUtils.OS_VERSION + " ... hardened runtime disabled!");
}
}

Expand Down
Loading