Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apiVersion attribute not being respected #59

Open
russjr08 opened this issue Sep 5, 2021 · 2 comments
Open

apiVersion attribute not being respected #59

russjr08 opened this issue Sep 5, 2021 · 2 comments

Comments

@russjr08
Copy link

russjr08 commented Sep 5, 2021

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! 👍🏼

@osipxd
Copy link
Member

osipxd commented Sep 6, 2021

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.

@russjr08
Copy link
Author

russjr08 commented Sep 6, 2021

Thanks for the quick response! You hit the nail on the head with that workaround, that was indeed the issue!

@osipxd osipxd added this to the Next milestone Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants