Cloning, Building and Compiling the Spigot Source

Feb 26, 2020
Cloning, Building and Compiling the Spigot Source
  • Cloning, Building & Compiling the Spigot Source

    Getting a copy of Spigot to develop on properly


    • Basic Git Knowledge
    • A Unix-based system or a bash interpreter (such as Cygwin, Git Bash, etc.)
    • Maven 3.0.5 with a path setup

    Getting the Source(top)

    It is recommended to use BuildTools to automatically clone and setup the workspace. The below instructions might work to manually set it up but they might also be outdated and not up to date with the current workflow.

    First, start by cloning the Spigot source. If you would like to create a fork, You will need to create an account on JIRA. Fill in the SpigotMC CLA and wait up to 24 hours for your Stash account to be activated. Please ensure that your username and email addresses match. Once your account has been activated, Log into Stash using your JIRA credentials. Then you can create a fork, push your code changes, and then submit it for review.

    Next, switch to whichever branch you wish to build off using "git checkout <branch>" (Master, snapshot, test branches, etc.)

    Initiate an update of the downstream Bukkit and CraftBukkit builds via "git submodule update --init"

    Once it has finished downloading, you can now apply the Spigot patches by executing the "./" file in the root of the source folder.

    Once this is finished, you now have a full, ready to use copy of the spigot source under Spigot-Server and Spigot-API.

    Building Spigot(top)

    Once you have finished editing your changes in your IDE or text editing program of choice, go back the the root of the source and, using Maven, do a clean build ("mvn clean install") and let it run.

    You can now find your custom Spigot build in ./Spigot/Spigot-Server/target/spigot-genericMinecraftVersion-GenericBukkitBuildVersion.jar

    Creating a patch file for commit or local usage(top)

    Go into the directory of whichever part of Spigot (API/Server) you made your changes to.

    Bring your changed files to the stage and commit them locally.

    Head back to the root directory and execute the ./ file.

    You can now find your .patch in the relevant folder ((Craft)Bukkit-patches) within the root directory as the last patch file (assuming you did not play with time or use multiple commits.)
  • Loading...
  • Loading...