Solved Could not resolve io.papermc.paperweight:paperweight-userdev

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

rec

New member
May 12, 2025
4
0
1
I can build the paperweight-test-plugin from PaperMC github. But I can't build my project written in kotlin.
The project was initialy created with Intellij minecraft development plugin
build.gradle.kts:
Java:
plugins {
    kotlin("jvm") version "2.1.20"
    id("io.papermc.paperweight.userdev") version "2.0.0-beta.16"
    id("com.gradleup.shadow") version "8.3.0"
    id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.2.0"
}

group = "me.RecReo.dedbodies"
version = "0.1"

repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/") {
        name = "papermc-repo"
    }
    maven("https://oss.sonatype.org/content/groups/public/") {
        name = "sonatype"
    }
//    gradlePluginPortal()
//    maven("https://repo.papermc.io/repository/maven-public/")
}

dependencies {
    paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT")
    compileOnly("io.papermc.paper:paper-api:1.21.5")
    implementation("org.jetbrains.kotlin:kotlin-stdlib")
}

val targetJavaVersion = 21
kotlin {
    jvmToolchain(targetJavaVersion)
}

tasks.build {
    dependsOn("shadowJar")
}

tasks.processResources {
    val props = mapOf("version" to version)

    inputs.properties(props)
    filteringCharset = "UTF-8"
    filesMatching("plugin.yml") {
        expand(props)
    }
}

tasks {
    compileKotlin {
        kotlinOptions {
            jvmTarget = "21"
        }
    }
    compileJava {
        options.release.set(21)
    }
    javadoc {
        options.encoding = Charsets.UTF_8.name()
    }
}

tasks.shadowJar {
    destinationDirectory.set(file("outpath"))
    archiveBaseName.set("plugin")
    archiveVersion.set("")
    archiveClassifier.set("")
    dependencies {
        include(dependency("org.jetbrains.kotlin:kotlin-stdlib"))
    }
}

everything else is the same. I have read other posts but I can't figure it out.
If I change the version of paperweight to 1.7.7 another error message appears:
Code:
Expected configuration ':paperweightDevelopmentBundle' to contain exactly one file, however, it contains more than one file.
What files? Where are they?
Sorry, I am trying to make my first plugin.
If you can't help me fix this, how can I access the nms without paperweight? In the docs it is said about reflection but I don't understand how to use that?
Thank you
 

rec

New member
May 12, 2025
4
0
1
could you elaborate? i'm having this exact issue on gradle 8.14
if you are building with the wrapper (gradlew), run ./gradlew --version.
My gradle version was 8.13 but gradlew used 8.8. I don't know how to update it. I just reinitialised the project.