Awesome Open Source
Awesome Open Source

DependencyLoader Apache 2.0 License Current Release Commits since release Maven Central

Simple Maven Dependency Downloader for Spigot Plugins

How to get it!

Developers

Maven

<dependency>
    <groupId>com.sxtanna</groupId>
    <artifactId>DependencyLoader</artifactId>
    <version>LATEST</version>
</dependency>

Server Owners

Spigot Resource

Spigot Resource Click me

Dependency Loading

  • Specifically Entered in the Config
  • Loaded at runtime by other plugins

In Config

dependencies:
  kotlin-runtime:
    version: 1.1.1
    group: org.jetbrains.kotlin
    artifact: kotlin-runtime
    always-update: true
  kotlin-eap:
    version: 1.1.1-eap-26
    group: org.jetbrains.kotlin
    artifact: kotlin-stdlib-jre8
    repository: https://dl.bintray.com/kotlin/kotlin-eap-1.1/

Tags, 'always-update' and 'repository' are optional and explained in the default config

By a Plugin

public final class ExampleDepend extends JavaPlugin {

	// How Plugins will store Dependency IDs
	private static final Dependency KOTLIN_STDLIB = new Dependency("Kotlin-EAP", "1.1.1-eap-26", "org.jetbrains.kotlin", "kotlin-stdlib-jre8");

	static  {
		KOTLIN_STDLIB.getOptions().setCustomRepository("https://dl.bintray.com/kotlin/kotlin-eap-1.1/");
	}

	/**
	 *
	 * The Dependency will most likely not exist when this instance is created, so the main class should never reference it
	 * Instead create other classes to handle it, ie. KotlinClassThing
	 *
	 */


	@Override
	public void onLoad() {
		// Plugins can either call load from onLoad and then have normal usage in the onEnable
		DLoader.getInstance().load(KOTLIN_STDLIB);
	}

	@Override
	public void onEnable() {
		// "Normal Usage", at this point the Dependency will be loaded and available
		new KotlinClassThing();

		// Or Plugins could use this sort of logic in the onEnable alone, the instance of Database will be created after the dependency is loaded
		DLoader.getInstance().load(KOTLIN_STDLIB, KotlinClassThing::new);
	}

}
Alternatives To Dependency Loader
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Java (413,161
Plugin (113,352
Minecraft (14,521
Downloader (6,003
Spigot (2,650
Bukkit (2,642