Skip to content

Commit

Permalink
Make content in .zip launchable #1
Browse files Browse the repository at this point in the history
  • Loading branch information
durasj committed Apr 18, 2021
1 parent 11a3f58 commit 2926673
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ You can also override various messages and defaults by editing [src/main/resourc

- JDK 11+
- Maven
- Optional: Visual Studio Code as IDE as you can utilize the versioned settings.
- Optional: Visual Studio Code as IDE as you can utilize the versioned settings (launch config).

### Scripts
### Goals

#### `mvn package`

Prepares all essential application artifacts in `./target`:

- `dependency-jars/`
- `preparedJDK/` - JLink-ed JDK (JRE) prepared for bundling with the application.
- `whitelabel-*.jar` - Executable JAR with the application itself.
- `whitelabel-*.jar` - JAR with the application itself.

Assembles a .zip and .tar.xz with the content mention above and launch.sh/.bat which can be used to run it.

## License

Expand Down
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@
<module>java.datatransfer</module>
<module>java.net.http</module>
<module>java.logging</module>
<module>java.sql</module>
<module>java.scripting</module>
<!-- Needed for sun.misc.Unsafe used by JavaFX, shouldn't be used in our code -->
<module>jdk.unsupported</module>
<module>jdk.httpserver</module>
</addModules>
<options>
<option>--compress=2</option>
Expand All @@ -227,7 +229,7 @@
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
</descriptors>
<finalName>${artifactId}-${version}-${platform}</finalName>
<finalName>${project.artifactId}-${project.version}-${platform}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
Expand Down
23 changes: 15 additions & 8 deletions src/assembly/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,27 @@
<include>NOTICE*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/dependency-jars</directory>
<outputDirectory>/dependency-jars</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/preparedJDK</directory>
<outputDirectory>/preparedJDK</outputDirectory>
<outputDirectory>/jre</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/assembly</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>launch.*</include>
</includes>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.${packaging}</source>
<outputDirectory>/</outputDirectory>
<destName>${project.artifactId}.${packaging}</destName>
</file>
</files>
</assembly>
1 change: 1 addition & 0 deletions src/assembly/launch.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.\jre\bin\java -add-opens jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED --add-opens jdk.crypto.mscapi/sun.security.mscapi=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED -jar ./whitelabel.jar
2 changes: 2 additions & 0 deletions src/assembly/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Shell launcher for UNIX-like systems
./jre/bin/java --add-opens jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED -jar ./whitelabel.jar

0 comments on commit 2926673

Please sign in to comment.