Skip to content

[Bug] Duplicate JARs #2

Description

@StillLutto

Describe the bug
Remap task creating a file different from the one specified in shadowJar. My personal guess is that it's using the configuration inside of the setup convention plugin instead of the one defined inside of the first build.gradle.kts.

To Reproduce

  1. Use this code:
plugins {
    id("setup")
    id("com.gradleup.shadow")
    id("com.undefinedcreations.nova") version "0.0.4"
    id("com.undefinedcreations.echo") version "0.0.11"
    id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.3.0"
}

repositories {
    maven {
        name = "undefined-releases"
        url = uri("https://repo.undefinedcreations.com/releases")
    }
    maven {
        name = "undefined-snapshots"
        url = uri("https://repo.undefinedcreations.com/snapshots")
    }
}

val adventureVersion = properties["adventure_version"]!!

dependencies {
//    compileOnly(libs.spigotmc)
    echo("1.21.4", printDebug = true)

    // Undefined Creations Libraries
    implementation("com.undefined:stellar:1.0.1-SNAPSHOT")

    // Adventure
    implementation("net.kyori:adventure-api:$adventureVersion")
    implementation("net.kyori:adventure-text-minimessage:$adventureVersion")
    implementation("net.kyori:adventure-platform-bukkit:4.3.4")
    implementation("net.kyori:adventure-text-serializer-legacy:$adventureVersion")

    // Project Dependencies
    implementation(project(":core"))
}

tasks {
    shadowJar {
        archiveFileName = "server.jar"
    }
    runServer {
        minecraftVersion("1.21.4")
        perVersionFolder(true)
        acceptMojangEula()
    }
}

bukkitPluginYaml {
    name = "Cassini"
    version = properties["version"] as String
    main = "Main"
    apiVersion = "1.21"
    author = "StillLutto"
}
  1. Add this convention plugin called setup in your buildSrc directory:
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
    kotlin("jvm")
}

group = properties["group"]!!
version = properties["version"]!!
val adventureVersion = properties["adventure_version"]!!

repositories {
    mavenCentral()
    mavenLocal()
    maven {
        name = "paper-repo"
        url = uri("https://repo.papermc.io/repository/maven-public/")
    }
    maven {
        name = "minecraft-repo"
        url = uri("https://libraries.minecraft.net/")
    }
    maven {
        name = "spigot-repo"
        url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots")
    }
}

dependencies {
    compileOnly("net.kyori:adventure-api:$adventureVersion")
    compileOnly("net.kyori:adventure-text-minimessage:$adventureVersion")
    compileOnly("net.kyori:adventure-platform-bukkit:4.3.4")
    compileOnly("net.kyori:adventure-text-serializer-legacy:$adventureVersion")
}

tasks {
    compileKotlin {
        compilerOptions.jvmTarget = JvmTarget.JVM_1_8
    }
    compileJava {
        options.release = 8
    }
}

java {
    disableAutoTargetJvm()
}

kotlin {
    jvmToolchain(21)
}
  1. Run a server using Nova.
  2. Check the plugins directory somewhere inside of run, there should be two.

Expected behavior
Remap task not creating a separate file, instead just using the original one defined in the shadowJar task.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions