BukkitGradle
BukkitGradle copied to clipboard
apiVersion attribute not being respected
Hello,
I seem to be having an issue with having BukkitGradle pull in the 1.17 builds of Spigot/Paper:
Currently, my plugin's build.gradle file looks something like this:
plugins {
id "ru.endlesscode.bukkitgradle" version "0.10.0"
}
repositories {
papermc()
}
dependencies {
compileOnly(paperApi())
}
bukkit {
apiVersion = "1.17.1"
meta {
....
}
server {
// Core type. It can be 'spigot' or 'paper'
core = "paper"
....
}
}
The problem appears to be that I cannot get Gradle to pull in the 1.17.1 builds of Spigot or Paper. No matter what I set it to, it seems to utilize 1.16.4 when I analyze it in the dependencies view in IntelliJ

I've tried changing the repo between the papermc and spigot repos, as well as tried changing paperApi() to spigot() - it results in either Spigot or Paper 1.16.4 being resolved/downloaded. The builds that it downloads for the runServer task seems to be correct, but not the dependency used for compiling the code (using Material.COPPER_INGOT for example does not resolve at all, since it's present in 1.17 and above).
Even leaving off the apiVersion attribute, or changing it to something like 1.15.2 doesn't have an effect.
I've also tried invalidating caches via IntelliJ, as well as running gradle --refresh-depedencies, so I'm not sure if the issue is with gradle on my end, or via the BukkitGradle plugin.
Let me know if there's anything else I can provide that might help out with this! 👍🏼
Hello, thank you for your report!
I think I know where is the problem. Try to place dependencies block after bukkit block where you set apiVersion.
I can throw an error when apiVersion was changed after the moment it was already used.
Thanks for the quick response! You hit the nail on the head with that workaround, that was indeed the issue!