Exclude Unwanted Dependencies In Gradle

preview_player
Показать описание
It's a total pain when your application has issues because of unwanted dependencies on the classpath.

Thankfully in Gradle you can exclude dependencies, so in this video you'll see 3 example problems and 3 different approaches you can take to solve them.

▶️ Problems with unwanted dependencies 0:00
▶️ Excluding a single transitive dependency 0:17
▶️ Making an exclude more permanent 1:36
▶️ A safer alternative with module replacement rules 2:41

(all code examples in this video use the Gradle Kotlin DSL)

Рекомендации по теме
Комментарии
Автор

Thank you for all your Gradle videos - I've been slowly going through them all.
Also, the video editing looks superb!

henninghoefer
Автор

Great video. Learnt about module replacement. It's nice feature.

Anbu_Sampath
Автор

You are so good in showing important bits that I try to find out for gradle..thank you so much!! 👍

truelyindian
Автор

Thanks for watching! If this video was helpful, please GIVE IT A LIKE so other engineers can find it. 👍

TomGregoryTech
Автор

I was aware about only first way, u shared very useful thing thanks❤

bhagyashreekute
Автор

Thanks, now I know how to exclude unused log4j :)

megamen
Автор

Hi Tom.
Could you create a video.
How to analyse build.gradle in an existing application.
Like each thing and every closure.
Like why this code is written in build.gradle.
Like how and what to refer.
Each and everything.
Like What a developer has to do to understand.

I am sure, It will be big help for many people/developers like me. I watched your videos, but, still unable to understand my company projects...

Please help.

AvinashKumar-mhsi
Автор

Hi Tom. How to exclude transitive dependency for specific flavor in the whole project?

СкейтСкетчер
Автор

I got Task 'run' not found in root project 'Dummy App - Kotlin'. and
Configuration 'runtimeClasspath' not found in configuration container.
, How can I fix that ?

MMLProfessional
Автор

Hi Tom,
I have an requirement of including only one transitive dependency and exclude the rest..
For my case I tried excluding command but it’s leading me to write around 20lines of exclusion it’s making the code look ugly, any better way to implement this logic(exclude all except one transitive dependency)

Supriyashinde
Автор

Can we use here Gradle Platform Plugin?

MrVitalirapalis
Автор

how to exclude the dependency from other project which also include in some project -i.e- A, B two project, B is dependent on A so it has used in their gradle "compile project ('A")" but here B also want to remove some dependency in A . any idea how we can remove the dependency from 'A' so that it should not be included in 'B'

MukeshSingh-sbme
Автор

Or May be, A video series..
Something like, gradle for java developer...
Please think about it...
Please help.

AvinashKumar-mhsi
Автор

How can I remove a specific class file from a JAR file in Gradle? I am also getting multiple SLF4J bindings... one from and other is from

dineshgoyal