juliarn / npc-lib

Asynchronous, high-performance Minecraft NPC library for 1.8-1.21 servers.
MIT License
296 stars 50 forks source link

Unable to shadow v3 into the jar #98

Open ytnoos opened 1 year ago

ytnoos commented 1 year ago

Hi, I wanted to swtich from v2 to v3 but since I did, NPC-Lib is not getting shadowed inside my plugin JAR even if the only thing I changed is the version. (the dependency is found correctly). I also put these lines to be sure it wasn't getting excluded for some reasons shadow 'com.github.juliarn.NPC-Lib:api:3.0.0-beta2' shadow 'com.github.juliarn.NPC-Lib:bukkit:3.0.0-beta2'

derklaro commented 1 year ago

This has to be an issue on your side. You could post your gradle setup so I can take a look if I can see the cause, but it's 100% not our fault :)

ytnoos commented 1 year ago

Sure! I opened an issue because I didn't find any other ways to ask for help. It's a bit strange because v2 shadows without any issue.

game: https://paste.coralmc.it/ukoqamisim.rb api-game: https://paste.coralmc.it/wobeyayewe.properties main build.gradle: https://paste.coralmc.it/vusudakeya.properties

kingOf0 commented 1 year ago

I know a month is passed. But, this can help to further viewers.

Docs says:

Dependencies added to the shadow configuration are not bundled into the output JAR.

When using shadow NPC-Lib won't be shaded into jar. You must use implementation instead of shadow.

I'm not sure why v2 is worked. There could be another jar which added lib to the class path.

ytnoos commented 1 year ago

Already tried with implementation, I used shadow just as a test

kingOf0 commented 1 year ago

Can you send your current gradle files?

Also, can you send picture of your "external libraries" files. E.G. image

Edit:

Here's my current setup. I'm using kotlin dsl.

build.gradle.kts

dependencies {
    implementation("com.github.juliarn.NPC-Lib:npc-lib-bukkit:3.0.0-beta3")
}

I'm also relocating it.

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
    relocate("com.github.juliarn", "com.kingOf0.farmer.shade.juliarn")
}