I’m using the gradle shadow plugin in my java project.
JavaScript
x
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
I used the following code to get rid of all the dependencies I could.
JavaScript
shadowJar {
dependencies {
exclude(dependency("org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT"))
exclude(dependency("org.jetbrains:annotations:22.0.0"))
exclude(dependency("com.comphenix.protocol:ProtocolLib:4.7.0"))
}
}
However, I’ve got all these extra files in my jar file. I want to remove everything except what’s in the “eu” folder and the “plugin.yml”. How can I do this?
Advertisement
Answer
Don’t use shadowJar {} unless you have to, just change “implementation” to “compileOnly” for the dependencies you don’t want in the jar