Skip to content

CodeMC/hy-maven-squasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hy-maven-squasher

A tool to "squash" the Hytale Server JAR file. It converts the original fat JAR (which contains all dependencies bundled inside) into a thin JAR that only contains the server code, along with a generated pom.xml file that lists all the external dependencies.

This allows for better dependency management and smaller distribution sizes for development.

Prerequisites

  • Deno (v1.40 or newer recommended)

Installation

  1. Clone this repository.
  2. Ensure Deno is installed and available in your system path.

Usage

You can run the tool using the defined Deno task:

deno task squash /path/to/HytaleServer.jar

Or run the script directly:

deno run --allow-all squash.ts /path/to/HytaleServer.jar

Options

  • --debug: Preserves the temporary directories (debug_extract and debug_build) in the output folder for inspection.
deno task squash /path/to/HytaleServer.jar --debug

How It Works

  1. Extraction: Unzips the provided Hytale Server JAR into a temporary directory.
  2. Analysis:
    • Scans for all pom.xml files inside the JAR.
    • Identifies "internal" modules (starting with com.hypixel).
    • Identifies "shaded" libraries (libraries already present in the JAR).
    • Extracts a minimal set of external dependencies required by the server.
  3. Repackaging:
    • Copies the com/hypixel directory (the actual server code) and necessary resources like manifests.json and migration folder.
    • Generates a valid Maven pom.xml listing the detected external dependencies.
    • Zips everything into a new file named HytaleServer-squashed.jar.

Output

The tool creates an out directory containing:

  • HytaleServer-squashed.jar: The thin server JAR.
  • pom.xml: The Maven project file describing the server and its dependencies.

About

A tool to "squash" the Hytale Server JAR file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published