DependencyManager 1.0.8

DependencyManager is a lightweight plugin that downloads, caches and loads dependencies at runtime

  1. DotRar
    Native Minecraft Version:
    1.13
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    Source Code:
    https://github.com/Dot-Rar/DependencyManager
    Please visit the Github Wiki for full documentation!

    What is DependencyManager?

    DependencyManager is an extremely lightweight Bukkit plugin that aims to eliminate the need for dependency shading, creating large jar files, and to create a solution to the numerous resources on Spigot which only contain the Kotlin / Scala runtimes.

    How does it work?
    Plugins run an API method included in DependencyManager which loads downloads, caches and loads the dependency from a remote URL (or locally if the file has been cached).

    Loading a dependency
    Loading a dependency is extremely simple. Let's load version [code single]0.7.2[/code] of TOML4J as an example:
    Code (Text):
    Dependency toml4j = new MavenCentralDependency(this, "com.moandjiezana.toml", "toml4j", "0.7.2");
    toml4j.load(() -> { // This consumer runs once the dependency has been loaded
        System.out.println("Toml4J has been loaded!");
        Toml toml = new Toml().read(file);
    }, (ex) -> { // This consumer runs if an error occurs while loading the dependency
        System.out.println("An error has occurred while loading Toml4J");
        ex.printStackTrace();
    });
    This can even be simplified to the following one-liner:
    Code (Text):
    new MavenCentralDependency(this, "com.moandjiezana.toml", "toml4j", "0.7.2").load(this::start, Throwable::printStackTrace);
    Which repositories does it support?
    Currently, DependencyManager supports:

    - Maven Central
    - Sonatype (Releases / Snapshot / Staging)
    - Bintray (including JCenter)
    - JitPack
    - Remote URLs (e.g. a jar on a web server)

    However, it is extremely easy to add your own. For example, the following class would add your own Nexus repository:

    Code (Text):
    public class CustomNexusDepdendency extends NexusDependency {
        public CustomNexusDepdendency (Plugin owner, String group, String artifact, String version) {
            super(owner, "http://yourrepo.com/", group, artifact, version);
        }
    }
    Use the Github Wiki sidebar for information on your specific repository.

    Using DependencyManager
    I use JitPack to host my build artifacts. Click here to be taken to the JitPack setup page.
    Here's an example of how a [code single]build.gradle[/code] will look:
    Code (Text):
    repositories {
        maven { url 'https://jitpack.io' }
    }
     
    dependencies {
        compileOnly 'com.github.Dot-Rar:DependencyManager:master-SNAPSHOT'
    }
    Kagrurnaax, Poslovitch and TomCreeper like this.

Recent Updates

  1. v1.0.8
  2. v1.0.7