packetevents icon indicating copy to clipboard operation
packetevents copied to clipboard

Shading packetevents-spigot with Gradle Shadow causes its plugin.yml to override my plugin’s plugin.yml

Open heyhey123-git opened this issue 1 month ago • 3 comments

Describe the bug When producing a fat JAR with Gradle Shadow and adding com.github.retrooper:packetevents-spigot:2.10.0 as an implementation dependency, the plugin.yml inside that dependency replaces my own src/main/resources/plugin.yml in the final artifact, breaking my plugin metadata.

Software brand Gradle Kotlin DSL (build.gradle.kts) Shadow plugin: com.gradleup.shadow 9.0.0-beta15 Kotlin: 2.2.21, JDK: 21 paperweight: 2.0.0-beta.18 (paperDevBundle("1.21.8-R0.1-SNAPSHOT")) Dependency: com.github.retrooper:packetevents-spigot:2.10.0

Plugins Please give us a list of your plugins. Sometimes we run into incompatibilities. Having an overview of the plugins on your server can really help identify the problem quicker. Eg. ViaVersion, ProtocolLib, HolographicDisplays You may also provide a screenshot.

How To Reproduce

  • Add implementation("com.github.retrooper:packetevents-spigot:2.10.0") to build.gradle.kts.
  • Keep project’s plugin.yml in src/main/resources.
  • Run gradlew clean shadowJar.
  • Inspect the shaded JAR; plugin.yml is from PacketEvents, not from the project.

Expected behavior The shaded JAR should retain the project’s own plugin.yml.

Actual Behavior The shaded JAR contains plugin.yml from packetevents-spigot, overriding the project file.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Workaround (for users) Control Shadow’s input order and duplicate strategy so the project resources win.

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
    duplicatesStrategy = org.gradle.api.file.DuplicatesStrategy.EXCLUDE
}

heyhey123-git avatar Oct 31 '25 14:10 heyhey123-git