sVoxelDev/spigot-plugin-template

Question - Regarding Adding Dependencies

TheGrayEvil opened this issue · 1 comments

How do i add the ProtocolLib dependency to my plugin. Please Help thank you

You can add it as a gradle dependency here: https://github.com/Silthus/spigot-plugin-template/blob/master/build.gradle#L60

See the official ProtocolLib documentation here: https://github.com/aadnk/ProtocolLib
You will also need to add the maven repo.

The final build.gradle will look like this (assuming you did not add any other dependencies, yet).

repositories {
    mavenCentral()
    jcenter()
    spigot()
    maven { url = 'https://jitpack.io' }
    
    // this is the protocollib maven repo
    maven { url "https://repo.dmulloy2.net/repository/public/" }
}

dependencies {
    compileOnly spigot(mcVersion)

    //Add dependencies here
   // this is the protocollib dependency
   compileOnly group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.6.0";

    //Test dependencies
    testImplementation 'org.junit.jupiter:junit-jupiter:5.+'
    testImplementation "org.mockito:mockito-core:3.+"
    testImplementation mockBukkit()
    testImplementation 'org.assertj:assertj-core:3.+'
}