#Adding libraries to plugins using Gradle

1 messages · Page 1 of 1 (latest)

pearl briar
#

Hey, I am currently trying to add a library into my plugin. From what I understand I can't just add it as a implementation but have to shadow it or add it either to the servers or to the plugins classpath. How do I do that?

fringe pike
#

you do define it as an implementation dependency

#

and then also use the shadow plugin to actually shade it

#

think of it as specifying a dep as compile scope in maven and then also defining the shade plugin

cerulean fulcrum
#

When using the gradle shadow plugin
implementation -> shadowing
compile -> not shadowing

pearl briar
#

So I just need to add the plugin to my build.gradle and don't do anything else?

fringe pike
#

[14:58] LynxPlay: and then also use the shadow plugin to actually shade it

#

also, plugin ?

pearl briar
#

Gradle plugin

fringe pike
#

ohhh

pearl briar
#

I am using gradle

fringe pike
#

ah. Well you need to then basically run the shadowJar task

#

or have your build task depend on it

#

but ye

pearl briar
#

I add it like this:

plugins {
    id 'java'
    id "com.github.johnrengelman.shadow" version "7.1.2"
}
fringe pike
#

Yea

pearl briar
fringe pike
#

it does not