Code Monkey home page Code Monkey logo

hdl's Introduction

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


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

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

    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
<!-- Just the Core -->
<dependency>
    <groupId>com.heretere.hdl</groupId>
    <artifactId>core</artifactId>
    <version>Version</version>
</dependency>
<!-- Spigot Version -->
<dependency>
    <groupId>com.heretere.hdl</groupId>
    <artifactId>bukkit</artifactId>
    <version>Version</version>
</dependency>
Gradle
repositories {
    mavenCentral()
}
//Just the Core
dependencies {
    implementation 'com.heretere.hdl:core:Version'
}
//Spigot Version
dependencies {
    implementation 'com.heretere.hdl:bukkit:Version'
}

hdl's People

Contributors

conclube avatar heretere avatar hakan-krgn avatar alfiejfs avatar imajindevon avatar robertlit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.