Completely reworked packaging mechanics to create a more reliable result.

This commit is contained in:
Brendan Robert 2016-01-30 13:02:11 -06:00
parent a460696cdf
commit e2dd52fbfc

View File

@ -6,6 +6,12 @@
<name>OutlawEditor</name> <name>OutlawEditor</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>org.badvision.outlaweditor.Application</mainClass>
<netbeans.hint.license>apache20</netbeans.hint.license>
</properties>
<organization> <organization>
<!-- Used as the 'Vendor' for JNLP generation --> <!-- Used as the 'Vendor' for JNLP generation -->
<name>org.badvision</name> <name>org.badvision</name>
@ -14,27 +20,52 @@
<finalName>OutlawEditor</finalName> <finalName>OutlawEditor</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>com.zenjava</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>javafx-maven-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>8.1.2</version> <version>2.10</version>
<configuration>
outlawEditor
<mainClass>org.badvision.outlaweditor.Application</mainClass>
<!-- only required if signing the jar file -->
<keyStoreAlias>example-user</keyStoreAlias>
<keyStorePassword>example-password</keyStorePassword>
<allPermissions>true</allPermissions>
<bundleType>ALL</bundleType>
</configuration>
<executions> <executions>
<execution> <execution>
<id>package</id> <id>unpack-dependencies</id>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>jar</goal> <goal>unpack-dependencies</goal>
</goals> </goals>
<configuration>
<excludeScope>system</excludeScope>
<excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${java.home}/../bin/javapackager</executable>
<arguments>
<argument>-createjar</argument>
<argument>-nocss2bin</argument>
<argument>-appclass</argument>
<argument>${mainClass}</argument>
<argument>-srcdir</argument>
<argument>${project.build.directory}/classes</argument>
<argument>-outdir</argument>
<argument>${project.build.directory}</argument>
<argument>-outfile</argument>
<argument>${project.build.finalName}.jar</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
@ -43,12 +74,12 @@
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
<version>3.1</version> <version>3.5</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId> <groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId> <artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version> <version>0.13.1</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -97,7 +128,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>4.12</version>
<scope>test</scope> <scope>test</scope>
<type>jar</type> <type>jar</type>
</dependency> </dependency>