slimjar
slimjar copied to clipboard
Cannot resolve GSON
This is likely due to MirrorSelector removing central, The simplest solution atm would be to provide a MirrorSelector implementation that does not remove Central. (https://github.com/slimjar/slimjar/blob/master/slimjar/src/main/java/io/github/slimjar/app/builder/ApplicationBuilder.java#L293)
As a lambda it should just be
(a, b) -> a
still getting the same error
Kindly provide your slimjar.json file from your jar
it because the internal repository which is https://repo.vshnv.tech/
down and slimjar tries to get com.google.code.gson:gson:2.8.6
from the repository. here
the actual solution is that changing the internal repository like that;
.internalRepositories(Collections.singleton(new Repository(new URL(SimpleMirrorSelector.ALT_CENTRAL_URL))));
Still not working with the same error
Still not working with the same error
maybe you can try what i did in my own branch
SimpleMirrorSelector.DEFAULT_CENTRAL_MIRROR_URL -> SimpleMirrorSelector.ALT_CENTRAL_URL
Done. But I still get the same error
did you run ./gradlew publishToMavenLocal command? because the own branch is working on my projects.
Found the issue: https://github.com/slimjar/slimjar/blob/master/slimjar/src/main/java/io/github/slimjar/resolver/reader/facade/ReflectiveGsonFacadeFactory.java#L81 https://github.com/slimjar/slimjar/blob/master/slimjar/src/main/java/io/github/slimjar/relocation/facade/ReflectiveJarRelocatorFacadeFactory.java#L127
The default mirror selector is still active here hence it switches central to repo.vshnv.tech again
Fixed by editing this line.