at.yawk.mdep:mdep-loader

Maven plugin and library for loading maven dependencies remotely at runtime.

License

License

GroupId

GroupId

at.yawk.mdep
ArtifactId

ArtifactId

mdep-loader
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Maven plugin and library for loading maven dependencies remotely at runtime.

Download mdep-loader

How to add to project

<!-- https://jarcasting.com/artifacts/at.yawk.mdep/mdep-loader/ -->
<dependency>
    <groupId>at.yawk.mdep</groupId>
    <artifactId>mdep-loader</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/at.yawk.mdep/mdep-loader/
implementation 'at.yawk.mdep:mdep-loader:1.0.1'
// https://jarcasting.com/artifacts/at.yawk.mdep/mdep-loader/
implementation ("at.yawk.mdep:mdep-loader:1.0.1")
'at.yawk.mdep:mdep-loader:jar:1.0.1'
<dependency org="at.yawk.mdep" name="mdep-loader" rev="1.0.1">
  <artifact name="mdep-loader" type="jar" />
</dependency>
@Grapes(
@Grab(group='at.yawk.mdep', module='mdep-loader', version='1.0.1')
)
libraryDependencies += "at.yawk.mdep" % "mdep-loader" % "1.0.1"
[at.yawk.mdep/mdep-loader "1.0.1"]

Dependencies

provided (2)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.4
com.google.code.findbugs : annotations jar 3.0.0

test (2)

Group / Artifact Type Version
org.testng : testng jar 6.9.6
org.mockito : mockito-core jar 2.0.31-beta

Project Modules

There are no modules declared in this project.

mdep

Java dependency loader

General Setup

Maven:

<project>
    [...]

    <dependencies>
        [...]
        
        <dependency>
            <groupId>at.yawk.mdep</groupId>
            <artifactId>mdep-loader</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>at.yawk.mdep</groupId>
                <artifactId>mdep-maven-plugin</artifactId>
                <version>1.0-SNAPSHOT</version>
                
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>generate</goal>                            
                        </goals>
                    </execution>
                </executions>

                <configuration>
                    <excludes>
                        <!-- Add artifacts you do not want to include - that's probably this project. -->
                        [...]
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Java:

new DependencyLoader()
        .downloadDependencies()
        .toParentLastClassLoader()
        .loadClass("MyClass");

Bukkit

public class MyLoader extends JavaPlugin {
    @Override
    public void onLoad() {
        try {
            new DependencyLoader(getLogger())
                    .downloadDependencies()
                    .addUrls(((URLClassLoader) getClassLoader()).getURLs())
                    .toParentLastClassLoader()
                    .loadClass("MyPlugin").newInstance();
        } catch (IOException e) {
            getLogger().log(Level.SEVERE, "Failed to load cricket dependencies, cricket will not start!", e);
            return;
        }
    }
}

Versions

Version
1.0.1
1.0