An open API service indexing awesome lists of open source software.

https://github.com/heretere/hdl

Heretere's Dependency Loader
https://github.com/heretere/hdl

bukkit java spigot

Last synced: 8 months ago
JSON representation

Heretere's Dependency Loader

Awesome Lists containing this project

README

          

# Heretere's Dependency Loader



Maven Central


Lines of code


GitHub code size in bytes


GitHub license

### Description

Heretere's Dependency Loader is a runtime maven dependency handler. It has powered using a Gradle plugin to make solving transitive dependencies simple.

### Why?

Certain websites have capped jar sizes, this library allows you to supply a much smaller jar size without sacrificing
the amount of libraries you use in your project.

### Documentation
- [Wiki](https://github.com/heretere/hdl/wiki)

---

# Features

- Automatically downloads, and loads maven dependencies at runtime
- Easily create your own runtime dependency types on top of Maven
- Downloads are cached to your plugin's data folder or to a different specified directory
- Relocation isn't required since files are loaded into an isolated classloader

#### Currently, Supported Dependency Types

- All Maven repos

---

# Examples

## Gradle Plugin

```kotlin
plugins {
id("com.heretere.hdl.plugin") version "2.0.0"
}

dependencies {
// instead of implementation("com.google.guava:guava:31.0-jre")
hdl("com.google.guava:guava:31.0-jre")
}
```

The plugin will automatically include the core dependency so you can invoke it at runtime.

## Main Class

```java
import com.heretere.hdl.impl.DependencyLoader;

public class Main {
public static void main(String[] args) {
DependencyLoader loader = new DependencyLoader(/*Define a dependency directory path here*/);

boolean success = loader.loadDependencies();

if (!success) {
throw new RuntimeException("Failed to load dependencies")

//dependencies successfully loaded
}
}
}
```

---

# Usage

Usage without Gradle plugin

Maven

```xml

com.heretere.hdl
core
Version

```

```xml

com.heretere.hdl
bukkit
Version

```

Gradle

```groovy
repositories {
mavenCentral()
}
```

```groovy
//Just the Core
dependencies {
implementation 'com.heretere.hdl:core:Version'
}
```

```groovy
//Spigot Version
dependencies {
implementation 'com.heretere.hdl:bukkit:Version'
}
```