1.15.2 Gradle Problem(Error Building)

Discussion in 'Spigot Plugin Development' started by Snowmite, Mar 18, 2020.

  1. I'm very new to gradle...
    Here is my current gradle code:
    Code (Text):
    plugins {
        id 'java'
    }

    group 'me.snowmite.covid.Core'
    version '1.0-SNAPSHOT'

    sourceCompatibility = 1.8

    jar {
        manifest {
            attributes(
                    'Main-Class': 'my.project.main',
            )
        }
    }

    task fatJar(type: Jar) {
        manifest.from jar.manifest
        classifier = 'all'
        from {
            configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
        } {
            exclude "META-INF/*.SF"
            exclude "META-INF/*.DSA"
            exclude "META-INF/*.RSA"
        }
        with jar
    }

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url 'https://jitpack.io' }
        maven {
            url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'

            // As of Gradle 5.1, you can limit this to only those
            // dependencies you expect from it
            content {
                includeGroup 'org.bukkit'
                includeGroup 'org.spigotmc'
            }
        }
        maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }

    }

    dependencies {
        testCompile group: 'junit', name: 'junit', version: '4.12'
        compileOnly 'org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT' // The Spigot API with no shadowing. Requires the OSS repo.
        compileOnly 'org.bukkit:bukkit:1.15.2-R0.1-SNAPSHOT' // The Bukkit API with no shadowing.
        compileOnly 'org.spigotmc:spigot:1.15.2-R0.1-SNAPSHOT' // The full Spigot server with no shadowing. Requires mavenLocal.
        compileOnly 'org.bukkit:craftbukkit:1.15.2-R0.1-SNAPSHOT' // The full CraftBukkit server with no shadowing. Requires mavenLocal.
        compile 'org.jsoup:jsoup:1.13.1'
        implementation 'com.github.KwabenBerko:News-API-Java:1.0.0'

    }
     
    This is the error in the build console:
    Code (Text):
    Execution failed for task ':compileJava'.
    > Could not resolve all files for configuration ':compileClasspath'.
       > Could not find org.spigotmc:spigot:1.15.2-R0.1-SNAPSHOT.
         Searched in the following locations:
           - file:/C:/Users/Mustafa/.m2/repository/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - file:/C:/Users/Mustafa/.m2/repository/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.pom
           - file:/C:/Users/Mustafa/.m2/repository/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.jar
           - https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.pom
           - https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.jar
           - https://jitpack.io/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - https://jitpack.io/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.pom
           - https://jitpack.io/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.jar
           - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.pom
           - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.jar
           - https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.pom
           - https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.15.2-R0.1-SNAPSHOT/spigot-1.15.2-R0.1-SNAPSHOT.jar
         Required by:
             project :
       > Could not find org.bukkit:craftbukkit:1.15.2-R0.1-SNAPSHOT.
         Searched in the following locations:
           - file:/C:/Users/Mustafa/.m2/repository/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - file:/C:/Users/Mustafa/.m2/repository/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.pom
           - file:/C:/Users/Mustafa/.m2/repository/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.jar
           - https://repo.maven.apache.org/maven2/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - https://repo.maven.apache.org/maven2/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.pom
           - https://repo.maven.apache.org/maven2/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.jar
           - https://jitpack.io/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - https://jitpack.io/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.pom
           - https://jitpack.io/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.jar
           - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.pom
           - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.jar
           - https://oss.sonatype.org/content/repositories/snapshots/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/maven-metadata.xml
           - https://oss.sonatype.org/content/repositories/snapshots/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.pom
           - https://oss.sonatype.org/content/repositories/snapshots/org/bukkit/craftbukkit/1.15.2-R0.1-SNAPSHOT/craftbukkit-1.15.2-R0.1-SNAPSHOT.jar
         Required by:
             project :

    Possible solution:
    - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html