Skip to content

Commit 9e46a86

Browse files
authored
Merge pull request #276 from Osiris-Team/devel
Devel
2 parents edd95e5 + 904ad12 commit 9e46a86

File tree

107 files changed

+5577
-2575
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+5577
-2575
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.gradle
22
**/build/
3+
**/.idea/
34

45
# Package Files #
56
bin

README.md

+31-15
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Add the following `plugin` tag to your `pom.xml`:
3030
<plugin>
3131
<groupId>io.github.fvarrui</groupId>
3232
<artifactId>javapackager</artifactId>
33-
<version>1.6.7</version>
33+
<version>1.7.0</version>
3434
<executions>
3535
<execution>
3636
<phase>package</phase>
@@ -78,7 +78,7 @@ buildscript {
7878
mavenCentral()
7979
}
8080
dependencies {
81-
classpath 'io.github.fvarrui:javapackager:1.6.7'
81+
classpath 'io.github.fvarrui:javapackager:1.7.0-SNAPSHOT'
8282
}
8383
}
8484
@@ -88,15 +88,17 @@ apply plugin: 'io.github.fvarrui.javapackager.plugin'
8888
Create your packaging task:
8989

9090
```groovy
91-
task packageMyApp(type: io.github.fvarrui.javapackager.gradle.PackageTask, dependsOn: build) {
92-
// mandatory
93-
mainClass = 'path.to.your.mainClass'
94-
// optional
95-
bundleJre = true|false
96-
generateInstaller = true|false
97-
administratorRequired = true|false
98-
platform = auto|linux|mac|windows
99-
additionalResources = [ file('file path'), file('folder path'), ... ]
91+
task packageMyApp(type: io.github.fvarrui.javapackager.GradlePackageTask, dependsOn: build) {
92+
javapackager{
93+
// mandatory
94+
mainClass = 'path.to.your.mainClass'
95+
// optional
96+
bundleJre = true|false
97+
generateInstaller = true|false
98+
administratorRequired = true|false
99+
platform = auto|linux|mac|windows
100+
additionalResources = [ file('file path'), file('folder path'), ... ]
101+
}
100102
linuxConfig {
101103
...
102104
}
@@ -106,6 +108,12 @@ task packageMyApp(type: io.github.fvarrui.javapackager.gradle.PackageTask, depen
106108
winConfig {
107109
...
108110
}
111+
manifest {
112+
....
113+
}
114+
scripts {
115+
...
116+
}
109117
...
110118
}
111119
```
@@ -118,6 +126,10 @@ And execute the next command in project's root folder:
118126
gradle packageMyApp
119127
```
120128

129+
### Package your app via CI
130+
131+
- **GitHub:** You can find an example workflow file [here](https://github.com/fvarrui/JavaPackager/blob/pr-248/test/hello-world-maven/.github/workflows/package.yml).
132+
121133
### Generated artifacts
122134

123135
By default it will generate next artifacts in `${outputDirectory} ` folder:
@@ -161,21 +173,25 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
161173
| `extra` | :x: | | Map with extra properties to be used in customized Velocity templates, accesible through `$info.extra` variable. |
162174
| `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. |
163175
| `forceInstaller` | :x: | `false` | If `true`, skips operating system check when generating installers. |
176+
| `nativeImage` | :x: | `false` | If `true`, generates a native image for the current operating system. Note that `jdkVendor` must be set to `graalvm` for this to work. |
177+
| `sharedLibrary` | :x: | `false` | If `true`, generates a shared library for the current operating system. Note that `jdkVendor` must be set to `graalvm` for this to work. |
164178
| `generateInstaller` | :x: | `true` | Generates an installer for the app. |
165-
| `jdkPath` | :x: | `${java.home}` | JDK used to generate a customized JRE. It allows to bundle customized JREs for different platforms. |
179+
| `jdkVersion` | :x: | `latest` | JDK version to download and use. The latest version is used by default. See all available versions here: [adoptium](https://api.adoptium.net/v3/info/available_releases). |
180+
| `jdkVendor` | :x: | `graalvm` | JDK vendor to download the JDK from. Currently supported: `adoptium, graalvm` |
181+
| `jdkPath` | :x: | `null` | If null downloads (if necessary and also updates it if needed) the right JDK for the selected platform and sets this value to `<temp-dir>/jdk/win` or `<temp-dir>/jdk/linux` or `<temp-dir>/jdk/mac`. The downloaded JDK will be used to generate a customized JRE. |
166182
| `jreDirectoryName` | :x: | `"jre"` | Bundled JRE directory name. |
167183
| `jreMinVersion` | :x: | | JRE minimum version. If an appropriate version cannot be found display error message. Disabled if a JRE is bundled. |
168184
| `jrePath` | :x: | `""` | Path to JRE folder. If specified, it will bundle this JRE with the app, and won't generate a customized JRE. For Java 8 version or least. |
169185
| `licenseFile` | :x: | `${project.licenses[0].url}` or `${basedir}/LICENSE` or `${projectdir}/LICENSE` | Path to project license file. |
170186
| `mainClass` | :heavy_check_mark: | `${exec.mainClass}` | Full path to your app main class. |
171187
| `manifest` | :x: | | [Allows adding additional entries to MANIFEST.MF file.](docs/manifest.md) |
172188
| `modules` | :x: | `[]` | Modules to customize the bundled JRE. Don't use `jdeps` to get module dependencies. |
173-
| `name` | :x: | `${project.name}` or `${project.artifactId}` | App name. |
189+
| `appName` | :x: | `${project.name}` or `${project.artifactId}` | App name. |
174190
| `organizationName` | :x: | `${project.organization.name}` or `"ACME"` | Organization name. |
175191
| `organizationUrl` | :x: | `${project.organization.url}` | Organization website URL. |
176192
| `organizationEmail` | :x: | | Organization email. |
177193
| `outputDirectory` | :x: | `${project.build.directory}` or `${project.builddir}` | Output directory (where the artifacts will be generated). |
178-
| `packagingJdk` | :x: | `${java.home}` | JDK used in the execution of `jlink` and other JDK tools. |
194+
| `packagingJdk` | :x: | `null` or same as `jdkPath` | JDK used in the execution of `jlink` and other JDK tools. If null `jdkPath` will be used. |
179195
| `platform` | :x: | `auto` | Defines the target platform, which could be different to the execution platform. Possible values: `auto`, `mac`, `linux`, `windows`. Use `auto` for using execution platform as target. |
180196
| `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. |
181197
| `scripts` | :x: | | Specify bootstrap script. **Pre and post-install scripts comming soon!** |
@@ -198,7 +214,7 @@ By default it will generate next artifacts in `${outputDirectory} ` folder:
198214
199215
### Plugin assets
200216

201-
Any [asset used by JavaPackager](https://github.com/fvarrui/JavaPackager/tree/master/src/main/resources), such as application icons or templates, can be replaced just by placing a file with the same name in `${assetsDir}` folder organized by platform.
217+
Any [asset used by JavaPackager]([JavaPackager/src/main/resources at master · fvarrui/JavaPackager · GitHub](https://github.com/fvarrui/JavaPackager/tree/master/src/main/resources)), such as application icons or templates, can be replaced just by placing a file with the same name in `${assetsDir}` folder organized by platform.
202218

203219
```bash
204220
${assetsDir}/

build.gradle

+20-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212
repositories {
1313
mavenLocal()
1414
mavenCentral()
15-
maven {
15+
maven {
1616
url 'https://plugins.gradle.org/m2/'
1717
}
1818
}
@@ -46,31 +46,40 @@ dependencies {
4646
implementation 'org.apache.maven:maven-plugin-api:3.6.0'
4747
implementation 'org.codehaus.plexus:plexus-utils:3.1.1'
4848
implementation 'org.twdata.maven:mojo-executor:2.3.0'
49-
implementation 'commons-io:commons-io:2.6'
49+
implementation 'commons-io:commons-io:2.7'
5050
implementation 'org.apache.commons:commons-lang3:3.9'
5151
implementation 'org.apache.commons:commons-collections4:4.1'
5252
implementation 'org.apache.commons:commons-compress:1.21'
53-
implementation 'org.apache.velocity:velocity-engine-core:2.0'
53+
implementation 'org.apache.velocity:velocity-engine-core:2.3'
5454
implementation 'org.vafer:jdeb:1.9'
5555
implementation 'net.jsign:jsign-core:3.1'
5656
implementation 'org.redline-rpm:redline:1.2.10'
5757
implementation 'io.github.fvarrui:launch4j:2.5.2'
58+
implementation 'com.google.code.gson:gson:2.9.0'
59+
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
60+
implementation 'org.rauschig:jarchivelib:1.2.0'
61+
implementation 'com.squareup:javapoet:1.13.0'
5862

59-
testImplementation 'junit:junit:4.12'
63+
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
64+
testImplementation 'org.apache.maven.shared:maven-invoker:3.2.0'
6065

6166
compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.0'
6267

6368
mavenEmbedder 'org.apache.maven:maven-embedder:3.6.0'
64-
mavenEmbedder 'org.apache.maven:maven-compat:3.6.0'
69+
mavenEmbedder 'org.apache.maven:maven-compat:3.6.0'
6570
mavenEmbedder 'org.slf4j:slf4j-simple:1.7.30'
6671
mavenEmbedder 'org.eclipse.aether:aether-connector-basic:1.1.0'
6772
mavenEmbedder 'org.eclipse.aether:aether-transport-wagon:1.1.0'
6873
mavenEmbedder 'org.apache.maven.wagon:wagon-http:3.4.1'
6974
mavenEmbedder 'org.apache.maven.wagon:wagon-provider-api:3.4.1'
7075
}
7176

77+
test {
78+
useJUnitPlatform()
79+
}
80+
7281
group = 'io.github.fvarrui'
73-
version = '1.6.7'
82+
version = '1.7.0'
7483
description = 'Hybrid Maven/Gradle plugin to package Java applications as native Windows, Mac OS X or GNU/Linux executables and create installers for them'
7584

7685
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -86,6 +95,11 @@ publishing {
8695
}
8796
}
8897

98+
java {
99+
withSourcesJar()
100+
// and/or analogously use "withJavadocJar()" to get a "javadocJar" task
101+
}
102+
89103
install.repositories.mavenInstaller.pom.with {
90104
groupId = project.group
91105
artifactId = project.name

0 commit comments

Comments
 (0)