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:
parent
4152af4977
commit
71f614c90a
|
@ -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
|
||||
|
|
62
pom.xml
62
pom.xml
|
@ -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,26 +43,66 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<executable>java</executable>
|
||||
<arguments>
|
||||
<argument>-Djava.library.path="${project.build.directory}\natives"</argument>
|
||||
<argument>-cp</argument>
|
||||
<classpath />
|
||||
<argument>itdelatrisu.opsu.Opsu</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
<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>
|
||||
<argument>-cp</argument>
|
||||
<classpath />
|
||||
<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
BIN
tools/JarSplicePlus.jar
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user