Spigot Maven - Historical

Applied By Eldoria: May 25, 2021 at 4:06 PM

Spigot Maven

Spigot Maven Repository

Information on what to add to your pom.xml to access the Spigot API



Maven Repository(top)

SpigotMC has a Maven repository which can be used by plugin developers to add Spigot API to their build system.

The SpigotMC Maven repository provides two artifacts relevant to Spigot plugin development, the Bukkit API and the Spigot API. Developers unsure of which artifact to include should default to using the Spigot API. Most, if not all, uses for the Bukkit API artifact are covered by the Spigot API artifact. Note that this repository does not provide the implementation artifacts. Developers wishing to use internal, version-dependent code (e.g. CraftBukkit or NMS classes) must run BuildTools to install those artifacts to their local Maven repository.

pom.xml(top)

In order to access the Spigot API using Maven, developers need to add both of the following to the pom.xml: 1) the Spigot Maven repository and 2) the Spigot API artifact. These additions are excerpted in the following code snippet:
Code (XML):
<repositories>
    <!-- This adds the Spigot Maven repository to the build -->
    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <!--This adds the Spigot API artifact to the build -->
    <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.16.5-R0.1-SNAPSHOT</version>
           <scope>provided</scope>
    </dependency>
</dependencies>

build.gradle(top)

You can find more about the Spigot repositories for Gradle here.