Gradle includes libraries I don't want

I have a forked version of Lemur, lemur-1.15.1-PESEGATO.jar
On my gradle, I have

implementation 'com.github.Pesegato:lemur:1.15.1-PESEGATO'

But still when I build I get both versions of the libraries, because lemur-proto ask for com.simsilica:lemur:1.15.0

At runtime, the “wrong” version is picked and my game crashes. Is there a way to tell gradle do not include that library?

The search keyword I think you are looking for is “exclude”.

1 Like

I did something similar with Nifty:

configurations.all {
    resolutionStrategy.dependencySubstitution {
        substitute module('com.github.nifty-gui:nifty') with module('com.github.tonihele.nifty-gui:nifty:1.4-SNAPSHOT')
        substitute module('com.github.nifty-gui:nifty-default-controls') with module('com.github.tonihele.nifty-gui:nifty-default-controls:1.4-SNAPSHOT')
        substitute module('com.github.nifty-gui:nifty-style-black') with module('com.github.tonihele.nifty-gui:nifty-style-black:1.4-SNAPSHOT')
    }
}
4 Likes

That is probably a better way than trying to exclude it everywhere that sucks it in.

I went with

implementation ('com.simsilica:lemur-proto:[1.9,)') {
    exclude group:'com.simsilica', module: 'lemur'
}

But I guess your proposal is better… I’ll check it out.