npc-lib icon indicating copy to clipboard operation
npc-lib copied to clipboard

Unable to shadow v3 into the jar

Open ytnoos opened this issue 2 years ago • 5 comments

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'

ytnoos avatar Feb 22 '23 11:02 ytnoos

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 :)

derklaro avatar Feb 22 '23 17:02 derklaro

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

ytnoos avatar Feb 22 '23 19:02 ytnoos

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.

kingOf0 avatar Mar 25 '23 01:03 kingOf0

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

ytnoos avatar Mar 25 '23 02:03 ytnoos

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")
}

kingOf0 avatar Mar 25 '23 02:03 kingOf0

The readme contains some instructions how to relocate the lib now. If you still have these issues please open a new issue.

derklaro avatar Aug 21 '24 19:08 derklaro