Add jar bundler

This commit is contained in:
Oystein Kristoffer Tveit 2021-04-20 15:29:10 +02:00
parent d4d6be1930
commit f0a724888d
4 changed files with 56 additions and 0 deletions

43
pom.xml
View File

@ -102,6 +102,25 @@
<type>maven-plugin</type> <type>maven-plugin</type>
</dependency> </dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>13</version>
<classifier>win</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>13</version>
<classifier>linux</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>13</version>
<classifier>mac</classifier>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
@ -141,6 +160,7 @@
</configuration> </configuration>
</plugin> </plugin>
<!-- Plugin to generate code coverage reports -->
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
@ -162,6 +182,29 @@
</executions> </executions>
</plugin> </plugin>
<!-- Plugin to bundle dependencies to generate a jar file -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>app.MainLauncher</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -0,0 +1,7 @@
package app;
public class MainLauncher {
public static void main(String[] args) {
Main.main(args);
}
}

3
util/run.bat Normal file
View File

@ -0,0 +1,3 @@
@ECHO OFF
java --enable-preview target/banana-editor-1.0.0.jar

3
util/run.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
java --enable-preview target/banana-editor-1.0.0.jar