Skip to content
Sharp

Build Tools · interview question

In the context of Maven, what does it mean when a dependency is marked as 'optional'?

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

Correct answer

D. It does not affect the project's build if excluded

Why

An 'optional' dependency in Maven means that it is not required for the project's build to succeed. Other projects that depend on this project will not automatically inherit optional dependencies.

Test yourself on Build Tools

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

Start free test
All Build Tools questions →