You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
6
+
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.
7
7
8
-
> SNAPSHOT version is not released to Maven Central, so you have to [install it manually](#how-to-build-and-install-the-plugin).
8
+
> SNAPSHOT version (available in `devel` branch) is not released to Maven Central, so you have to [install it manually](#how-to-build-and-install-the-plugin).
9
9
10
10
> :eyes: See [JavaPackager changes and fixes](https://github.com/fvarrui/JavaPackager/releases).
11
11
12
12
## History
13
13
14
-
It was born while teaching to my students how to build and distribute their Java apps, and after seeing that a chain of several plugins was needed to achieve this task, I decided to develop a plugin :ring: to govern them all.
14
+
It was born while teaching to my students how to build and distribute their Java apps, and after seeing that a chain of several plugins was needed to achieve this task, I decided to develop a plugin :ring: to rule them all.
|`${name}-${version}-${platform}.zip`| Zipball containing generated directory `${name}`. | All ||
138
138
|`${name}-${version}-${platform}.tar.gz`| Compressed tarball containing generated directory `${name}`. | All ||
139
139
|`assets`| Directory with all intermediate files generated by JavaPackager. | All ||
@@ -157,7 +157,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
157
157
|`customizedJre`|:x:|`true`| Generates a customized JRE, including only identified or specified modules. Otherwise, all modules will be included. |
158
158
|`description`|:x:|`${project.description}` or `${displayName}`| Project description. |
159
159
|`displayName`|:x:|`${project.name}` or `${name}`| App name to show. |
160
-
|`envPath`|:x:|| Defines PATH environment variable in GNU/Linux and Mac OS X startup scripts. |
160
+
|`envPath`|:x:|| Defines PATH environment variable in GNU/Linux and MacOS startup scripts.|
161
161
|`extra`|:x:|| Map with extra properties to be used in customized Velocity templates, accesible through `$info.extra` variable. |
162
162
|`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. |
163
163
|`forceInstaller`|:x:|`false`| If `true`, skips operating system check when generating installers. |
@@ -180,7 +180,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
180
180
|`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. |
181
181
|`scripts`|:x:|| Specify bootstrap script. **Pre and post-install scripts comming soon!**|
182
182
|`url`|:x:|| App website URL. |
183
-
|`useResourcesAsWorkingDir`|:x:|`true`| Uses app resources folder as default working directory (always `true` on Mac OS).|
183
+
|`useResourcesAsWorkingDir`|:x:|`true`| Uses app resources folder as default working directory (always `true` on MacOS). |
|`linuxConfig`|:x:|[GNU/Linux specific properties](docs/linux-specific-properties.md). |
194
-
|`macConfig`|:x:|[Mac OS X specific properties](docs/macosx-specific-properties.md). |
194
+
|`macConfig`|:x:|[MacOS specific properties](docs/macosx-specific-properties.md).|
195
195
|`winConfig`|:x:|[Windows specific properties](docs/windows-specific-properties.md). |
196
196
197
197
> :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`.
@@ -216,7 +216,7 @@ ${assetsDir}/
216
216
├── linux/
217
217
│ └── ${name}.png # on GNU/Linux it has to be a PNG file
218
218
├── mac/
219
-
│ └── ${name}.icns # on Mac OS X it has to be a ICNS file
219
+
│ └── ${name}.icns # on MacOS it has to be a ICNS file
220
220
└── windows/
221
221
└── ${name}.ico # on Windows it has to be a ICO file
222
222
```
@@ -239,7 +239,7 @@ ${assetsDir}/
239
239
| ├── mime.xml.vtl # MIME.XML template
240
240
│ └── startup.sh.vtl # Startup script template
241
241
├── mac/
242
-
| ├── assembly.xml.vtl # maven-assembly-plugin template to generate ZIP/TGZ bundles for Mac OS X
242
+
| ├── assembly.xml.vtl # maven-assembly-plugin template to generate ZIP/TGZ bundles for MacOS
@@ -262,7 +262,7 @@ You can use [default templates](https://github.com/fvarrui/JavaPackager/tree/mas
262
262
263
263
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.
264
264
265
-
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.
265
+
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.
266
266
267
267
The options should be separated with spaces or new lines:
268
268
@@ -294,12 +294,10 @@ Execute next commands in BASH (GNU/Linux or macOS) or CMD (Windows):
294
294
1. Download source code and change to the project directory:
description ='Hybrid Maven/Gradle plugin to package Java applications as native Windows, Mac OS X or GNU/Linux executables and create installers for them'
75
75
76
76
sourceCompatibility =JavaVersion.VERSION_1_8
@@ -86,6 +86,11 @@ publishing {
86
86
}
87
87
}
88
88
89
+
java {
90
+
withSourcesJar()
91
+
// and/or analogously use "withJavadocJar()" to get a "javadocJar" task
description 'Downloads and ovewrites compiled and scripted versions of universalJavaApplicationStub to src/main/resources/mac and overrides the existing ones.'
235
+
group 'Update assets'
236
+
description 'Downloads compiled and scripted versions of universalJavaApplicationStub to src/main/resources/mac overriding the existing ones.'
E.g. on Windows, running `packageMyApp` task will generate next artifacts:
121
121
122
122
*`${name}_${version}-linux.tar.gz` with the GNU/Linux application including a customized JRE.
123
-
*`${name}_${version}-mac.tar.gz` with the Mac OS X application including a customized JRE.
123
+
*`${name}_${version}-mac.tar.gz` with the MacOS application including a customized JRE.
124
124
*`${name}_${version}-windows.zip` with the Windows application including a customized JRE.
125
125
126
-
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.
126
+
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.
0 commit comments