Solved Running BuildTools doesn't add craftbukkit artifact

Discussion in 'Spigot Plugin Development' started by Fabian_Amundsen, Jul 10, 2021.

  1. In my spigot plugin I want to code with NMS, so I have to add craftbukkit as dependency to maven. But I can't find the needed files in my maven repos, even after I runned the build tools successfully. Is there anything I could have messed up there?
  2. But the pom.xml file doesn't recogise org.bukkit

    Shouln't the dependencies be also in your .m2 folder?
    #3 Fabian_Amundsen, Jul 10, 2021
    Last edited: Jul 10, 2021
  3. Ever since 1.15 or 1.16 (i forgot which one exactly), the default buildtools command doesn't compile the craftbukkit jar anymore. If you want it, you need to specify it using a commandline option:
    Code (Text):
    java -jar BuildTools.jar --compile craftbukkit
    So, for 1.17.1 you'd need:
    Code (Text):
    java -jar BuildTools.jar --compile craftbukkit --rev 1.17.1
    • Useful Useful x 1
  4. Choco


    Worth clarifying, however, that you really should not need CraftBukkit for any reason at this point. Exception to that being if an existing open source plugin depends on CraftBukkit in the pom.xml and you intend on building it manually. Outside of that, you can depend on the Spigot server artifact instead.
    • Like Like x 1
  5. That worked! Thank you!

    Isn't it nessesary for stuff like NMS (for example to make NPC's), because it isn't in the Spigot API?
  6. Spigot not Spigot-API.
    You misunderstanding.
  7. Choco


    Sure, but as I had mentioned you can use the Spigot Server instead. It's installed to your local Maven repository as well
    Code (XML):
    Spigot server is to Spigot API what CraftBukkit is to Bukkit
    • Like Like x 1
  8. Ah, yes, I get it now, thanks
    That will save me probably from some problems