Automated the fat jar creation process.

- Added a modified version of JarSplice in the tools/ directory, which can run using system properties as well as the GUI.  The project is located here: https://github.com/itdelatrisu/JarSplicePlus
- To create a fat jar, execute the Maven goal "install -Djar".  The output file will be in the target/ directory and suffixed "-runnable".

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2015-01-12 21:05:58 -05:00
parent 4152af4977
commit 71f614c90a
3 changed files with 58 additions and 12 deletions

View File

@ -39,9 +39,11 @@ opsu! is distributed as a Maven project.
* To run the project, execute the Maven goal `compile exec:exec`.
* To create a single executable JAR file, execute the Maven goal
`package shade:shade`. Note that the LWJGL native libraries must be linked and
distributed with this application; [JarSplice](http://ninjacave.com/jarsplice)
is included in the tools directory to merge the files into a fat jar.
`install -Djar`. This will link the LWJGL native libraries using a
[modified version](https://github.com/itdelatrisu/JarSplicePlus) of
[JarSplice](http://ninjacave.com/jarsplice), which is included in the
`tools` directory in both its original and modified forms. The resulting
file will be located in `target/opsu-${version}-runnable.jar`.
## Credits
This software was created by Jeffrey Han

44
pom.xml
View File

@ -10,12 +10,16 @@
<resources>
<resource>
<directory>res</directory>
<excludes>
<exclude>**/Thumbs.db</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
@ -39,7 +43,16 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>run</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${jar}</skip>
<executable>java</executable>
<arguments>
<argument>-Djava.library.path="${project.build.directory}\natives"</argument>
@ -48,17 +61,48 @@
<argument>itdelatrisu.opsu.Opsu</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>jarsplice</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<workingDirectory>${basedir}/target</workingDirectory>
<arguments>
<argument>-jar</argument>
<argument>-Dinput="opsu-${project.version}.jar"</argument>
<argument>-Dmain="itdelatrisu.opsu.Opsu"</argument>
<argument>-Doutput="opsu-${project.version}-runnable.jar"</argument>
<argument>${basedir}/tools/JarSplicePlus.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<!--
<artifactSet>
<excludes>
<exclude>*:*:natives*</exclude>
</excludes>
</artifactSet>
-->
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

BIN
tools/JarSplicePlus.jar Normal file

Binary file not shown.