Home > database >  Making a bukkit plugin for minecraft 1.19, gradle gives me this error
Making a bukkit plugin for minecraft 1.19, gradle gives me this error

Time:07-26

So I made a brand new project in IntelliJ IDEA CE (on MacOS 12.3.1), added the spigot dependencies to create a new plugin for the new version of Minecraft Java Edition 1.19. I upgraded my Gradle from 7.1 to 7.5 and my Java from 16 to 18. I made some code and wanted to test it by building a jar. However I got this error:

    Execution failed for task ':compileJava'.
    > Could not resolve all files for configuration ':compileClasspath'.
       > Could not find io.netty:netty-transport-native-epoll:4.1.77.Final.
         Searched in the following locations:
           - https://oss.sonatype.org/content/repositories/snapshots/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final.pom
           - https://oss.sonatype.org/content/repositories/central/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final.pom
           - file:/Users/[REDACTED]/.m2/repository/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final.pom
         Required by:
             project : > org.spigotmc:spigot:1.19-R0.1-SNAPSHOT
    
    Possible solution:
     - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

I honestly have never encountered an error about netty-transport(?) and need help fixing it. Here's my build.gradle:


    plugins {
        id 'java'
    }
    
    group 'me.Tim_M.antiChatReport'
    version '1.0.0-RELEASE'
    
    repositories {
        maven {
            url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    
            content {
                includeGroup 'org.bukkit'
                includeGroup 'org.spigotmc'
            }
        }
        maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
        maven { url = 'https://oss.sonatype.org/content/repositories/central' }
        mavenLocal()
    }
    
    dependencies {
        compileOnly 'org.spigotmc:spigot:1.19-R0.1-SNAPSHOT'
    }
    
    test {
        useJUnitPlatform()
    }
    
    jar {
        destinationDirectory.set(file('/Users/[REDACTED]/Desktop/Test Servers/Server 1.19/plugins'))
    }

After checking with cat in terminal, the file /Users/[REDACTED]/.m2/repository/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final.pom indeed exists.

CodePudding user response:

Wow I found the solution by trying random stuff, despite the path it shows being correct it wouldn't work until I for some reason added mavenCentral(). No idea why that is.

To fix this problem you specifically have to add mavenCentral() in repositories in build.gradle

  • Related