Skip to content
Sharp

Build Tools · interview question

How can you prevent Gradle from resolving a transitive dependency?

Multiple choiceHardchapter-10-curatedpremiumbuild-toolsdependency-management
Choose one answer
Answer and explanation

Correct answer

B. Use the 'exclude' keyword in the dependencies block

Why

You can prevent Gradle from resolving a transitive dependency by using the 'exclude' keyword in the dependencies block. This tells Gradle to ignore specific transitive dependencies when resolving dependencies.

Test yourself on Build Tools

A free test with instant, explained results. No account needed.

Start free test
All Build Tools questions →