Closed DavidTheExplorer closed 4 months ago
Instead of using implementation
you need to use shadowImpl
. This is done because in mods you want to be much more deliberate in what you include in your mod.
Instead of using
implementation
you need to useshadowImpl
. This is done because in mods you want to be much more deliberate in what you include in your mod.
It worked! :)
But I have a question: Why did it relocate a transitive dependency outside of the deps
package?
relocate works on package names. you will probably not want to shade gson at all, so you would want to exclude that dependency:
shadowImpl("my:dependency:1.0.0") {
exclude (group ="com.google.code.gson")
}
relocate works on package names. you will probably not want to shade gson at all, so you would want to exclude that dependency:
shadowImpl("my:dependency:1.0.0") { exclude (group ="com.google.code.gson") }
Why would I not want to shade GSON if my dependency depends on it? After you answer, you can close this because my problem is solved :)
Normally you would want to shade the dependency as well (and also specify that package to relocate). However gson is already present in minecraft, so you can just use that versionn.
I'm a Maven user who started modding a few days ago - Please forgive my basic gradle knowledge. I'm trying to create an Hypixel mod, so I added the hypixel api:
The mod works within the IDE, but not when I create a jar. I know from Maven that I need to shade and relocate the API, and I tried to do this: But when I do
build
the jar file still doesn't contain the API... What am I doing wrong?