Skip to content

Commit

Permalink
Mavenized. Just invoke the parent pom via mvn package -f parent-pom.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammerDan committed Apr 7, 2021
1 parent 13d0df2 commit 501ac1f
Show file tree
Hide file tree
Showing 23 changed files with 489 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/.classpath
/.project
/build
/.settings
*~
out
/resources/compiled
/resources/classes
/resources/target
/target/
**/dependency-reduced-pom.xml
*.json
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Haven and Hearth Client
=======================

Hi, ProgrammerDan here.

You've found an amazing project, Loftar's Haven and Hearth open source client. It has been modified by EnderWiggin, and now by ProgrammerDan.

The most significant change so far is that I've mavenized as much of the toolchain as I could.

Some ANT-bits remain, and for posterity (or those who enjoy `ant`) I've left build.xml where it is.

However, this project can now be build in one go via maven, as follows:

```
> mvn clean package -f parent-pom.xml
```

This will build the haven client; then, this will build the haven local resources jar, and put everything into the `target` folder.

You can double-click the hafen.jar file to run it, or invoke from the `target` folder using:

```
> javaw -jar hafen.jar -U http://game.havenandhearth.com/res/ game.havenandhearth.com
```

Enjoy, and happy playing Haven and Hearth.
80 changes: 80 additions & 0 deletions parent-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.havenandhearth</groupId>
<artifactId>hafen-parent</artifactId>
<version>1.0.0</version>
<name>HnH Client Parent</name>
<description>Mavenized Haven and Hearth Client orchestration pom.</description>
<packaging>pom</packaging>

<modules>
<module>.</module>
<module>resources</module>
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>

<compilerArgs>
<arg>-Xlint:unchecked</arg>
<arg>-Xlint:-options</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>project.local</id>
<name>project</name>
<url>file:${project.basedir}/repo</url>
</repository>
</repositories>
</project>
228 changes: 228 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.havenandhearth</groupId>
<artifactId>hafen</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>HnH Client</name>
<description>Mavenized Haven and Hearth Client, modified by EnderWiggin and ProgrammerDan</description>

<parent>
<groupId>com.havenandhearth</groupId>
<artifactId>hafen-parent</artifactId>
<version>1.0.0</version>
<relativePath>parent-pom.xml</relativePath>
</parent>

<build>
<sourceDirectory>src</sourceDirectory>
<finalName>hafen</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<!-- We use antrun b/c fetch and filegen is just easier with original build.xml fragments. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>res-jars</id>
<phase>generate-resources</phase>
<configuration>
<target>
<get src="http://www.havenandhearth.com/java/hafen-res.jar" dest="lib/hafen-res.jar" usetimestamp="true" />
<get src="http://www.havenandhearth.com/java/builtin-res.jar" dest="lib/builtin-res.jar" usetimestamp="true" />
<exec executable="git" outputproperty="gitrev" failifexecutionfails="false">
<arg line="rev-parse HEAD" />
</exec>
<tstamp>
<format property="iversion" pattern="dd.MM.yyyy HH:mm" />
</tstamp>
<echo file="target/classes/buildinfo">
git-rev = ${gitrev}
version = ${iversion}
</echo>
<echo message="done with generate" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- Shade is superior to expanding the jars into the classpath; same outcome but clearer steps -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>haven.MainFrame</Main-Class>
<Class-Path>jogl.jar gluegen-rt.jar client-res.jar builtin-res.jar hafen-res.jar</Class-Path>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>changelog.txt</resource>
<file>changelog.txt</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>haven/ressrv.crt</resource>
<file>etc/ressrv.crt</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>haven/authsrv.crt</resource>
<file>etc/authsrv.crt</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>haven/res-preload</resource>
<file>etc/res-preload</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>haven/res-bgload</resource>
<file>etc/res-bgload</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>haven/icon.png</resource>
<file>etc/icon.png</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>haven/font.ttf</resource>
<file>etc/font.ttf</file>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
<resource>META-INF/glob</resource>
<file>target/META-INF/glob</file>
</transformer>
</transformers>
<filters>
<filter>
<artifact>dolda:jglob</artifact>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
<filter>
<artifact>com.google.code.gson:gson</artifact>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
<filter>
<artifact>io.reactivex:rxjava</artifact>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
</filters>
<artifactSet>
<excludes>
<exclude>org.jogamp.gluegen:*</exclude>
<exclude>org.jogamp.jogl:*</exclude>
<exclude>javax.jnlp:*</exclude>
</excludes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<!-- We also need to shape the "target" folder, so that it's runnable from there. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<resources>
<resource>
<directory>lib</directory>
<filtering>false</filtering>
<includes>
<include>hafen-res.jar</include>
<include>builtin-res.jar</include>
<include>gluegen-rt.jar</include>
<include>jogl.jar</include>
</includes>
</resource>
<resource>
<directory>lib/jogl-natives</directory>
<filtering>false</filtering>
<includes>
<include>*.jar</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
</build>

<!-- For build purposes, all depedencies are listed here. Some public, some from local repo. -->
<dependencies>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.jnlp</groupId>
<artifactId>jnlp-api</artifactId>
<version>7.0</version>
</dependency>
<dependency>
<groupId>dolda</groupId>
<artifactId>jglob</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>
Binary file added repo/dolda/jglob/1.0/jglob-1.0.jar
Binary file not shown.
1 change: 1 addition & 0 deletions repo/dolda/jglob/1.0/jglob-1.0.jar.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6c7b0d9569167a31cc0a8fa544ac6ac6
1 change: 1 addition & 0 deletions repo/dolda/jglob/1.0/jglob-1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ea3070a8a00b14f3ef2a9a39e64b2cd17af5fce7
8 changes: 8 additions & 0 deletions repo/dolda/jglob/1.0/jglob-1.0.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>dolda</groupId>
<artifactId>jglob</artifactId>
<version>1.0</version>
</project>
1 change: 1 addition & 0 deletions repo/dolda/jglob/1.0/jglob-1.0.pom.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9058e98e9c617e12d8d6bda932ae9c74
1 change: 1 addition & 0 deletions repo/dolda/jglob/1.0/jglob-1.0.pom.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6a94ff59da60758b80419f0308e71ff199eb8259
12 changes: 12 additions & 0 deletions repo/dolda/jglob/maven-metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>dolda</groupId>
<artifactId>jglob</artifactId>
<versioning>
<release>1.0</release>
<versions>
<version>1.0</version>
</versions>
<lastUpdated>20210325043806</lastUpdated>
</versioning>
</metadata>
1 change: 1 addition & 0 deletions repo/dolda/jglob/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8d130fb6a890553f5aef1250f8feabb2
1 change: 1 addition & 0 deletions repo/dolda/jglob/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
102afc3d3fa5bcd81ca34b7834a7baf4d009da35
Binary file added repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar
Binary file not shown.
1 change: 1 addition & 0 deletions repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3dc14d59e1629a53473fe874ba0e9a7f
1 change: 1 addition & 0 deletions repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
30f65c08f06d5349ccb825b1625d2d2c751c2724
Loading

0 comments on commit 501ac1f

Please sign in to comment.